About 30,800 results
Open links in new tab
  1. Java Program to Implement Stack Data Structure

    Apr 26, 2024 · In this article, we will learn about Stack Data Structure and How to Implement it in Java. Stack Data Structure in Java. The Stack can be visualized as the collection of elements …

  2. Java Program to Implement stack data structure

    Java provides a built Stack class that can be used to implement a stack. import java.util.Stack; class Main { public static void main(String[] args) { // create an object of Stack class …

  3. Stack Class in Java - GeeksforGeeks

    Apr 15, 2025 · To implement a stack using a singly linked list, we need to ensure that all operations follow the LIFO (Last In, First Out) principle. This means that the most recently …

  4. Implement Stack using Array - GeeksforGeeks

    Mar 21, 2025 · To implement a stack using an array, initialize an array and treat its end as the stack’s top. Implement push (add to end), pop (remove from end), and peek (check end) …

  5. Java Stack - Exercises, Practice, Solution - w3resource

    May 9, 2025 · Implement stack operations such as push, pop, and check for the top element and empty stack. Also, sort, reverse, and find the maximum and minimum elements in a stack. …

  6. Custom Stack Implementation in Java - devglan

    In this article, we will be discussing implementing stack data structure in Java and perform multiple stack operations such as pop(), push() and peek(). We will also take a look at the time …

  7. Java Stack Tutorial: Stack Class Implementation With Examples

    Apr 1, 2025 · This Tutorial Explains What is Stack in Java, Java Stack Class, Stack API Methods, Stack Implementation using Array & Linked List with the help of Examples.

  8. Stack Program in Java - Sanfoundry

    Here is the source code of the Java program to implement a stack. The Java program is successfully compiled and run on a Windows system. The program output is also shown …

  9. Stack Implementation in Java - Techie Delight

    May 31, 2022 · Stack Implementation in Java A stack is a linear data structure that follows the LIFO (Last–In, First–Out) principle. That means the objects can be inserted or removed only at …

  10. How to Implement Stack in Java Using Array and Generics?

    Feb 14, 2023 · Stack is a linear Data Structure that is based on the LIFO concept (last in first out). Instead of only an Integer Stack, Stack can be of String, Character, or even Float type. There …

Refresh