Why is this code not printing out the print statement when I enter a name inside songRemove that matches the array.
Printable View
Why is this code not printing out the print statement when I enter a name inside songRemove that matches the array.
You should use the equals() method to compare the content of objects like String , not the == operator.
What is the second call to the nextLine() method for? The String it returns is not being saved.
Still does not fix the problem, heres my code now
Code java:
That fixes the problem I had here:
http://www.javaprogrammingforums.com...ring-read.html
Put that second, "unused" call to nextLine() in a println() to see what it reads.
Also printout the value of songRemove to see what its value is.
put it in a print ln as in System.out.println(keyboard.nextLine());??
ps. i discovered songRemove has no value, is this because of this 'unused' call?
Read the posts in http://www.javaprogrammingforums.com...ring-read.htmlQuote:
songRemove has no value
The problem is discussed there.
What was printed when you did that?Quote:
put it in a println as in
System.out.println("nL="+keyboard.nextLine() +"<");??