My teacher is using Console.ReadLine()
, but I've learned to use Scanner
.
int age = console.readLine("age: ");
and
System.out.println("age: ");
int age = scan.nextInt();
What is the difference between these?
Is it possible to write scan method in one line like
readLine
?How can I use console on IDES?