2

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();
  1. What is the difference between these?

  2. Is it possible to write scan method in one line like readLine?

  3. How can I use console on IDES?

Mad Physicist
  • 107,652
  • 25
  • 181
  • 264
gny77
  • 31
  • 4

0 Answers0