0
How to take input from user in java?
2 Answers
0
you can use this code snipet to get user input in java.
import import java.util.Scanner;
Scanner input = new Scanner(System.in);
int decimalnumber = input.nextInt();
hope this help?
0
You can do it in may ways but the widely used is by using Scanner class
also can import classes like
BufferedReader and InputStreamReader classes
DataInputStream class
Console class
import java.util.Scanner;
Scanner sc=new Scanner(System.in);
int rollno=sc.nextInt();
String name=sc.next();
String name=sc.next();