How can I write a method that deletes the last value of a list and returns the deleted value? If the list is empty, it should throw an exception. This is for a linkedlist class.
Thanks!
edit: nevermind! i’m allowed to use the java built in method. thanks!
java.util.LinkedList has the removeLast() method out of the box…