0
Can any one explain me the different ways to enter number from user sides?
means program ask you to enter number and then you can enter number
3 Réponses
0
Scanner scan = new Scanner(System.in);
int userNumber = scan.nextInt();
scan.close();
System.out.println(userNumber);
Check out the Scanner class in Java Docs for other "next" methods for different data types.
0
u can use Scanner class or BufferReader clasa of java to get the inputs from user. Scanner is most easy as compared to BufferReader
0
scanner, buffered reader , constructor , methods etc