scanner
✅ to use scanner import
1
Scanner sc = new Scanner(System.in);
✅ string
1
String input = sc.nextLine();
✅ other datatype
1
2
3
boolean bool = sc.nextBoolean();
int intNum = sc.nextInt();
double dblNum = sc.nextDouble();
This post is licensed under CC BY 4.0 by the author.