java learning day4

keyboard entry

Import package import java.util.Scanner

New object Scanner s=new Scanner(System.in);

x=s.nextInt();

Scan the data entered on the keyboard into the program through the scanner,
byte
short
int
long
float
double
String
boolean
char type scan with nextLine()

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325825040&siteId=291194637