public int length(){
int counter = 0;
Node temp = head;
while(temp!=null){
temp = temp.getNext();
counter++;
}
So if I say System.out.println((whatever).length());, it's supposed to print out a number, but my program always prints out a 0 no matter what. Apparently something's wrong but I'm not sure what...any help is very much appreciated! Thank you!

New Topic/Question
Reply




MultiQuote




|