access class members with linked list
Hello, I am not sure if my logic for implementing the following is correct. I have a linked list which works fine for primitive variables. I would like to store a list of a class called bullet which is
The node class is
public class Bullet
//construtor to set value of x and y
In the body of the program, I am trying to print out the x y values with code
public class ListNode
// constructors and other method.
ListNode current = firstNode;
System.out.println("%s ", current.bullet) and I get the address of the bullet. I am not sure how to access the x value of the class. I hope I gave you enough info. If not please let me know and I'll post more code.