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
  • 95,415
  • 23
  • 151
  • 231
gny77
  • 41
  • 4

0 Answers0