So I searched up what Anytype means and this is what I found:
"There is no particular construct in Java named “AnyType“. It is used to create “generic” classes that can perform operations on literally any data type or AnyType that extends a base class."
I was wondering if someone could explain this to me in simpler terms?
We are learning nodes and linked lists, and some code I found online for it looked like this:
public AnyType removeFirst() //Removes the first element in the list.
{
AnyType tmp = getFirst();
head = head.next;
return tmp;
}
This was retrieved from https://www.cs.cmu.edu/~adamchik/15-121/lectures/Linked%20Lists/code/LinkedList.java AND https://www.cs.cmu.edu/~adamchik/15-121/lectures/Linked%20Lists/linked%20lists.html
I don't understand its use in this context. Sorry if there are better places for to search.