NEW
Font size
WorksheetsJava Program Parts
Total questions: 22
Worksheet time: 35mins
Capitalization does NOT matter with Java.
True!
False!
When coding with Java,
System.out.println("Go Java!");
is the same code as
system.out.println("Go Java!");
True!
False!
The semicolon
;
is used like a period at the end of a coding sentence.
True!
False!
Is {
System.out.println("This is a literal print.");
System.out.print("Yea!");
System.out.println("Go Java!");
}
the same code as
{ System.out.println("This is a literal print."); System.out.print("Yea!"); System.out.println("Go Java!"); }
Yes
No
Why is {
System.out.println("This is a literal print.");
System.out.print("Yea!");
System.out.println("Go Java!");
}
"better" coding than
{ System.out.println("This is a literal print."); System.out.print("Yea!"); System.out.println("Go Java!"); }
It is a more efficient use of space
It is much easier to read, change, and debug
Do the spaces and new lines (enters) in the code change anything about what the program does or looks like?
Yes, the program runs differently because of spaces and enters in the code.
No, Yes, the program completely ignores spaces and enters in the code.
/*************************************
*Project: Day1Lab
*Programmer: Mrs. B.
*Date: October 2, 2023
*Program Name: Hello.java
**************************************/
What is this?
A change log
A link to the input output Java subfolder
The main method
The name of the program
/*************************************
*Project: Day1Lab
*Programmer: Mrs. B.
*Date: October 2, 2023
*Program Name: Hello.java
**************************************/
What does this do?
It is a list of who made changes and when those changes were made to the program
Tells the program where to get or send information needed to run the program
Tells the program where to start running. This part of the code runs first
The name of the class. This is linked to the ___.java folder with the same name.
import java.io*;
What is this?
A change log
A link to the input output Java subfolder
The main method
The name of the program
import java.io*;
What does this do?
It is a list of who made changes and when those changes were made to the program
Tells the program where to get or send information needed to run the program
Tells the program where to start running. This part of the code runs first
The name of the class. This is linked to the ___.java folder with the same name.
public class Hello
What is this?
A change log
A link to the input output Java subfolder
The main method
The name of the program
public class Hello
What does this do?
It is a list of who made changes and when those changes were made to the program
Tells the program where to get or send information needed to run the program
Tells the program where to start running. This part of the code runs first
The name of the class. This is linked to the ___.java folder with the same name.
public static void main (String[ ] args)
What is this?
A change log
A link to the input output Java subfolder
The main method
The name of the program
public static void main (String[ ] args)
What does this do?
It is a list of who made changes and when those changes were made to the program
Tells the program where to get or send information needed to run the program
Tells the program where to start running. This part of the code runs first
The name of the class. This is linked to the ___.java folder with the same name.
{
}
What are these?
French curly braces
aka. Squiggles
Output statements
Literal print
What the program will output.
Literal print (New line at end)
What the program will output.
System.out.println("This is a literal print.");
System.out.println("Go Java!");
What are these?
French curly braces
aka. Squiggles
Output statements
Literal print
What the program will output.
Literal print (New line at end)
What the program will output.
System.out.println("This is a literal print.");
System.out.print("Yea!");
System.out.println("Go Java!");
What are these?
French curly braces
aka. Squiggles
Output statements
Literal print
What the program will output.
Literal print (New line at end)
What the program will output.
System.out.print("Yea!");
What is this?
French curly braces
aka. Squiggles
Output statements
Literal print
What the program will output.
Literal print (New line at end)
What the program will output.
System.out.print("Yea!");
What does this do?
Tells the program parts when to start and when to stop
Creates what the user of the program will see
Will write the text in between the "..." in the program.
There will be no space or no new line after this text.
Will write the text in between the "..." in the program.
There will be a new line after this text.
{
}
What do these do?
Tell the program parts when to start and when to stop
Creates what the user of the program will see
Will write the text in between the "..." in the program.
There will be no space or no new line after this text.
Will write the text in between the "..." in the program.
There will be a new line after this text.
System.out.println("This is a literal print.");
System.out.print("Yea!");
System.out.println("Go Java!");
What do these do?
Tell the program parts when to start and when to stop
Creates what the user of the program will see
Will write the text in between the "..." in the program.
There will be no space or no new line after this text.
Will write the text in between the "..." in the program.
There will be a new line after this text.
System.out.println("This is a literal print.");
System.out.println("Go Java!");
What do these do?
Tell the program parts when to start and when to stop
Creates what the user of the program will see
Will write the text in between the "..." in the program.
There will be no space or no new line after this text.
Will write the text in between the "..." in the program.
There will be a new line after this text.
