i am coding a double linked list, in each node there are two slots, one for information and the other for data. Both inputs are choosen by user in console.The information slot is basically a string , meanwhile the Data slot must be an integer ( [information, data] <-- node is made like this,) now if i have more than one nodes on the linked list , i have to check if the new Node i am inputting into the list has the same Information and same data ( its ok if two nodes have same data OR same information)
public void nodiInformazioneguale(String information, int key) {
Node n = new Node(information, key, null, null);
if (n.getInformazione() == head.getNext().getInformazione()&&n.getData( == head.getNext().getData()) {
System.out.println("Insert another information && key");
}
}