comparing Strings in two ArrayLists
in
Programming Questions
•
2 years ago
hey ive got to ArrayLists one is a node which holds the details of the node like id name and so on. the second arraylist holds the connection of these nodes or there family. the family contains a dad, mam and any number of children.
what m trying to do is start with the first node which is a dad and connect it to the mam but there seems to be a problem when comparing the strings.
ive printed the start.nodeID and f.dad and they are the same, its probably a simple problem ive just bin lookin at it to long to see it any suggestions?
what m trying to do is start with the first node which is a dad and connect it to the mam but there seems to be a problem when comparing the strings.
ive printed the start.nodeID and f.dad and they are the same, its probably a simple problem ive just bin lookin at it to long to see it any suggestions?
- Node start = (Node) nodes.get(0);
for(Family f : famlies)
{
println(start.nodeID);
println(f.dad);
if(start.nodeID == f.dad)
{
println("he is a daddy");
if(f.mam != "")
{
println("There is a mammy");
for(Node n : nodes)
{
if(f.mam == n.nodeID)
{
println("Mammy printed");
n.formatNode();
n.draw();
}
}
}
}
}
1