Example Program
Quick Docs
User Input
// Read a string
String str = readLine(prompt);
// Read an integer
int num = readInt(prompt);
// Read a double
double myDouble = readDouble(prompt);
// Read a boolean
boolean bool = readBoolean(prompt);
// You should replace the word prompt with
// the question you'd like to ask. For example:
int age = readInt("What is your age? ");
- UserInput.java
Font Size
14
Parentheses autocomplete
Wrap lines
Editor
Theme
Code with blocks by default
Console Font Size
12
Console Theme
Display Server Graphics Screen
Show File Tab Bar
Debug Mode
11 UserInput
UserInput.java
1
2
/* This program prompts the user for their name
* and age, and then prints it back out.
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output
Docs
Example
More
History
Video
Download
About
W
This student is viewing this assignment in English. View this page in English?
Here is an example program to test user input! When you press “Run Code” in the right panel, the program will run and wait for you to enter a string, in thise case your name. Type your name and press enter!
Reset Code
Upload an image
Upload from your computer
Or paste a link here
Slides and Notes
No slides available for this video
About
Java (console)
Java Version 1.8.0_222