I'm having difficulty accessing values of an attribute of type Object. I have a class in which has as attributes in prox, and Object Item.
Each item is an object of the Subject class.
I'm having difficulty accessing values of an attribute of type Object. I have a class in which has as attributes in prox, and Object Item.
Each item is an object of the Subject class.
If items are always Subjects, why do not you declare them as Subject and not as Object?
Anyway, if you do not want / can change this, to access the Attributes of Subject, you need to cast, so java will try to convert the object to the type you want, you do this by informing the type in parentheses.
System.out.println("Desc:"+ ((Assunto)head.item).propriedadeDeAssunto);
Another tip is not good practice to access properties directly, instead make private properties and create get and set methods to access the values, so you maintain the encapsulation. If you are still studying and have not seen it, you will see in the future.