পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Thursday, January 19, 2017

Java.util.Stack Class

Introduction

The java.util.Stack class represents a last-in-first-out (LIFO) stack of objects.
  • When a stack is first created, it contains no items.
  • In this class, the last element inserted is accessed first.

Class declaration

Following is the declaration for java.util.Stack class:
public class Stack<E>
   extends Vector<E>

Class constructors

S.N. Constructor & Description
1 Stack()
This constructor creates an empty stack.

Class methods

S.N. Method & Description
1 boolean empty()
This method tests if this stack is empty.
2 E peek()
This method looks at the object at the top of this stack without removing it from the stack.
3 E pop()
This method removes the object at the top of this stack and returns that object as the value of this function.
4 E push(E item)
This method pushes an item onto the top of this stack.
5 int search(Object o)
This method returns the 1-based position where an object is on this stack.

Methods inherited

This class inherits methods from the following classes:
  • java.util.Vector
  • java.util.AbstractList
  • java.util.Object
  • java.util.List

No comments:

Post a Comment