Files
Testate/WS2425/Testat 3b/Stack.java
T
2025-07-21 16:03:34 +02:00

52 lines
813 B
Java

/**
* 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;
}
}