48 lines
750 B
Java
48 lines
750 B
Java
/**
|
|
* A list of strings.
|
|
*
|
|
* @author Marcus
|
|
*/
|
|
public class List {
|
|
|
|
/**
|
|
* Creates a new empty list.
|
|
*/
|
|
public List() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Appends a string at the end of the list.
|
|
*
|
|
* @param string The string to append.
|
|
*/
|
|
public void addLast(String string) {
|
|
// TODO: implement
|
|
}
|
|
|
|
/**
|
|
* Removes and returns the last string of
|
|
* the list. If the list is empty, the method
|
|
* returns null.
|
|
*
|
|
* @return The last string of the list or null,
|
|
* if the list ist empty.
|
|
*/
|
|
public String removeLast() {
|
|
// TODO: implement
|
|
return "ABCDEFG";
|
|
}
|
|
|
|
/**
|
|
* The number of strings in the list.
|
|
*
|
|
* @return The number of strings in the list.
|
|
*/
|
|
public int size() {
|
|
// TODO: implement
|
|
return -1;
|
|
}
|
|
|
|
}
|