|
1234567891011121314151617181920 |
- import java.util.Scanner;
-
- class Metoder {
- private static void converse(Scanner s) {
- System.out.println("What's your name?");
- String name = s.nextLine();
- System.out.println("Where do you live?");
- String city = s.nextLine();
-
- System.out.println("Hello, "+name+"! You are from "+city+".");
- }
-
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
-
- converse(s);
- converse(s);
- converse(s);
- }
- }
|