+ 1

Is it possible to take input in Java without importing/using any packages like util and io?

27th May 2020, 4:06 PM
KAUSTAV SAHA
KAUSTAV SAHA - avatar
5 Antworten
+ 1
Yes you can do that by using the fully qualified name within the main method. java.util.Scanner sc = new java.util.Scanner(System.in); String name = sc.nextLine();
27th May 2020, 5:22 PM
Avinesh
Avinesh - avatar
+ 1
use command line arguments input
27th May 2020, 7:00 PM
zemiak
0
Scanner class is a part of util package,isn't it?😢 Avinesh I wanted to know if it is possible to take input without using any common methods... like Scanner Class and BufferedReader.
27th May 2020, 5:23 PM
KAUSTAV SAHA
KAUSTAV SAHA - avatar
0
You said to do it without importing any packages. Do you see any import statement? I just answered what was asked, isn't it Kaustav Saha ?
27th May 2020, 5:26 PM
Avinesh
Avinesh - avatar
0
zemiak thanks
27th May 2020, 7:07 PM
KAUSTAV SAHA
KAUSTAV SAHA - avatar