scanner input string code example
Example 1: User input (scanner)
Scanner scanner = new Scanner(System.in);
System.out.println("What's your name?");
String name = scanner.nextLine();
System.out.println("What's your year of birth?");
int yearOfBirth = scanner.nextInt();
Example 2: User input (scanner)
int age = scanner.nextInt();
scanner.nextLine(); //Ez fogja az ottmaradt sorvége jelet beolvasni
String name = scanner.nextLine();