I am learning Java from Udemy, a complete java master class . For the "Abstract class problems" task, storytellers say that I have to create 2 links and 1 value in an abstract class.
In the solution, this is the result:
public abstract class ListItem {
protected ListItem rightLink = null;
protected ListItem leftLink = null;
protected Object object;
}
What makes links a link, not a value?
Both of them start with protected, then we have a type, then we have a variable name. The only difference is that the link is null.
But if done, for example:
private int myNumber = 10;
Above is not called a link, it is called an int variable myNumber with a value of 10.
source
share