Looking to get understanding of why something works in one place but doesn't work in another.
int maximum = 0;
for (int i = 0; i < g.nodeList.size(); i++)
// Printing and display the elements in ArrayList
if (maximum < g.nodeList.get(i).getOutgoingEdges().size())
maximum = g.nodeList.get(i).getOutgoingEdges().size();
String Test = g.getNodeList().size();
System.out.println("Node "+ Test + " has the most outgoing edges (" + maximum + ").\n");
for(Node name : g.getNodeList()) {
System.out.println(name.getAbbrev());
System.out.println(name.getOutgoingEdges().size());
}
why cant I call name.getAbbrev() and place that in my String Test?