Created
July 27, 2021 22:12
-
-
Save desoga10/ede322f6de3287a928c1a6b5d03d870a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```java | |
import java.util.Scanner; | |
public class HelloWorld { | |
public static void main(String[] args) { | |
// Creates a reader instance which takes | |
// input from standard input - keyboard | |
Scanner reader = new Scanner(System.in); | |
System.out.print("Enter a number: "); | |
// nextInt() reads the next integer from the keyboard | |
int number = reader.nextInt(); | |
// println() prints the following line to the output screen | |
System.out.println("You entered: " + number); | |
} | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment