add code
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* A stack of strings.
|
||||
*
|
||||
* @author Marcus
|
||||
*/
|
||||
public class Stack {
|
||||
|
||||
/**
|
||||
* Creates a new empty stack.
|
||||
*/
|
||||
public Stack() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the specified string on top
|
||||
* of the stack.
|
||||
*
|
||||
* @param string The string to add.
|
||||
*/
|
||||
public void addToTop(String string) {
|
||||
// TODO: implement
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes and returns the string on
|
||||
* top of the stack or null, if the
|
||||
* stack is empty.
|
||||
*
|
||||
* @return The last item that has been
|
||||
* pushed onto the stack or null, if
|
||||
* the stack is empty.
|
||||
*/
|
||||
public String removeFromTop() {
|
||||
// TODO: implement
|
||||
return "ABCDEFG";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current number of
|
||||
* strings on the stack.
|
||||
*
|
||||
* @return The current number of strings
|
||||
* on the stack.
|
||||
*/
|
||||
public int size() {
|
||||
// TODO: implement
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user