0
How to use scanner
4 Answers
+ 4
Complete sololearn java course literally it is one of the first lessons
So youâll know fastly
0
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
double b=sc.nextDouble();
String c=sc.next();
System.out.println("integer umber is "+a);
System.out.println(b+c);
0
//import the Scanner class from java.util package
import java.util.Scanner;
public class Main {
public static void main(String [] args) {
// instantiate the Scanner class
Scanner sc = new Scanner(System.in);
System.out.println("Enter your name:");
String name = sc.nextLine();
}
}
run this code and you'll figure out...also finish some tutorials you will know the basics