Guest User

Untitled

a guest
Apr 16th, 2023
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6.  
  7. /**
  8.  *
  9.  * @author ensia
  10.  */
  11. import java.util.ArrayList;
  12. public class Stack {
  13.     private ArrayList<String>stack;
  14.    
  15.     public boolean isEmpty(){
  16.         if(stack.isEmpty()){
  17.         return true;
  18.         }
  19.         return false;
  20.     }
  21.    
  22.     public void add(String value){
  23.         this.stack.add(value);
  24.     }
  25.     public ArrayList<String> values(){
  26.        return this.stack;
  27.     }
  28.    
  29. }
  30.  
Add Comment
Please, Sign In to add comment