I'm trying to print out the stored data of my LinkedList with toString method with the code below:
class Node {
public Record poi;
public Node next;
public Node(Record poi) {
this.poi = poi;
}
}
class RankList {
private Node first;
private int nodeCount;
private Record record;
public static void main(String[] args) {
RankList list = new RankList();
Point point = new Point(5.4, 3.2);
Record record = new Record(1, point, 8.2);
System.out.println(list.insert(record));
System.out.println(list.toString);
}
@Override
public String toString() {
return String.format("Node(%d,)", id); //...
}
I'm trying to show something like that and to see that the data is stored correctly.
Node 1=> Id:1 Score:8.2 Point: 5.4,3.2
Node 2=> ...
But the thing I get as a result is the following:
Node@7a79be86