1
I’m having trouble accessing values from an Object attribute. I have a No class that has No attributes, and Object Item.
Each item is an object of the Subject class.
I queue the items of the class No normally, however when I try to print, I get only the item object as return... How do I enter the Object type (item) and access the Subject attributes?
This code is responsible for printing:
public void imprime() {
System.out.println(size);
for (int i = 0; i < size; i++) {
System.out.println("Desc:"+ head.item);
head = head.getProximo();
}
}