Status: Not Started
Quick Docs
Variables
// Declare a variable
int myVarName;
// Initialize a variable
int myVarName = 5;
// Assign to an existing variable
myVarName = 10;
// A few types of data
int myInt = 5;
double myDouble = 9.9;
boolean myBoolean = true;
char myChar = 'a';
String myString = "Karel";
- Variables.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
9 Our First Integer
Variables.java
1
2
public class Variables extends ConsoleProgram
{
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output
Docs
Exercise
More
History
Textbook
Video
Download
About
W
This student is viewing this assignment in English. View this page in English?
2 points
Write a program that declares an int named year
and set
it equal to the current year. Then print it out.
If it were the year 2016, the output should say:
The current year is 2016
Note: You must include the current year and the word “year” in your output.
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