1
0
mirror of https://github.com/quinton-ashley/java2js synced 2024-12-29 10:11:54 +01:00
java2js/tests/ScannerTest.java
Quinton Ashley 724da27d51 1.2.17
2022-04-30 10:07:11 -05:00

21 lines
459 B
Java

package tests;
import java.util.Scanner;
public class ScannerTest {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Hello world!");
System.out.print("What's your name: ");
String name = sc.nextLine();
System.out.println("Hello " + name);
System.out.print("What's your favorite number: ");
int age = sc.nextInt();
System.out.println(age + "? That's my favorite too!");
sc.close();
}
}