- 5
String
8 Answers
+ 8
What language do you use?
+ 8
What do you mean read characters?
Read from what?
Do you want to get input from users?
+ 3
import java.util.Scanner;
Scanner scan= new Scanner(System.in);
That makes a scanner, the use it like
String name=scan.nextLine();
int age=scan.nextInt();
There are different types as you can see. I read that you shouldn't use the same scanner for both Strings and integers.
+ 3
Or as a method, because I am bored
String name;
public static String input(String x){
Scanner scan = new Scanner(System.in);
System.out.println(x);
return scan.nextLine();
}
name=input("Enter Your Name - ");
System.out.println("Your Name Is " + name);
+ 2
what is your question ..
+ 1
How I can read characters?
+ 1
I'm using Java