0
While using scanner code playground is throwing error
import java.util.Scanner; public class Program { public static void main(String[] args) { System.out.println("Enter your username: "); Scanner BB = new Scanner(System.in); String Bike = BB.nextline(); System.out.println("Bike name is" + BB); } }
4 Answers
+ 2
nextLine() with a capital L
+ 1
u must print bike and not bb i.e scanner itself..like
system.out.println("bike name is" + bike);
0
Still giving me same error stating cannot find symbol BB.nextline();
0
Also as in eclipse or intellj after printing the value the next line comes into picture, here we need to give the value at very start @ChaoticDawg it helped