Skip to content

Instantly share code, notes, and snippets.

@desoga10
Created July 27, 2021 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save desoga10/ede322f6de3287a928c1a6b5d03d870a to your computer and use it in GitHub Desktop.
Save desoga10/ede322f6de3287a928c1a6b5d03d870a to your computer and use it in GitHub Desktop.
```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