So this is the context for my question.
I created a singly linked list whose nodes' attribute is an Object variable so i can store objects from different classes. So far so good.
public class Node
{
Object data;
Node next;
public Node(Object data)
{
this.data=data;
this.next=null;
}
[...]
}
Thing is i don't know how to recover attributes/methods from the stored objects. This one for example.
public class Product
{
double discount;
double price;
public double getPrice() {
return price;
}
[...]
Help.