Skip to content

Instantly share code, notes, and snippets.

@AnimeshShaw
Created June 13, 2015 15:53
Show Gist options
  • Select an option

  • Save AnimeshShaw/41d5565979bc51ff191f to your computer and use it in GitHub Desktop.

Select an option

Save AnimeshShaw/41d5565979bc51ff191f to your computer and use it in GitHub Desktop.
JStack Interface
package com.codehackersblog.JStack;
/**
*
* @author Psycho_Coder
* @param <T>
*/
public interface StackInterface<T> {
/**
*
* @param item This method push the item passed into the stack
*/
public abstract void push(T item);
/**
*
* @return This method removes the top element from the stack
*/
public abstract T pop();
/**
*
* @return This method returns whether the stack is empty or not
*/
public abstract boolean isEmpty();
/**
*
* @return This Methods returns the top element of the stack
*/
public abstract T peek();
/**
*
* @return This method returns the size of the stack
*/
public abstract int size();
/**
*
* @return This method returns the array of the items in the stack
*/
public abstract String display();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment