0
how to get input from keyboard
scanner
2 Answers
0
you get input from keyboard using Scanner class,
to use scaneer class you should have to import java.util package in your program.
than create the object of scanner class and use this object to get input from keyboard
0
Example
import java.util.Scanner; <<< This very importrant!
public class Scan {
public static void main(String[] args) {
Scanner klavye = new Scanner(System.in);
System.out.println(âEnter numberâ);
int a = klavye.nextInt();
int b = klavye.nextInt();
System.out.println(âTotal=â+(a+b));
}
}