wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Program Parts

Total questions: 22

Worksheet time: 35mins

Name
Class
Date
1.

Capitalization does NOT matter with Java.

a)

True!

b)

False!

2.

When coding with Java,

System.out.println("Go Java!");

is the same code as

system.out.println("Go Java!");

a)

True!

b)

False!

3.

The semicolon

;

is used like a period at the end of a coding sentence.

a)

True!

b)

False!

4.

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!"); }

a)

Yes

b)

No

5.

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!"); }

a)

It is a more efficient use of space

b)

It is much easier to read, change, and debug

6.

Do the spaces and new lines (enters) in the code change anything about what the program does or looks like?

a)

Yes, the program runs differently because of spaces and enters in the code.

b)

No, Yes, the program completely ignores spaces and enters in the code.

7.

/*************************************

 *Project:  Day1Lab

 *Programmer:  Mrs. B.

 *Date:  October 2, 2023

 *Program Name:  Hello.java

**************************************/

What is this?

a)

A change log

b)

A link to the input output Java subfolder

c)

The main method

d)

The name of the program

8.

/*************************************

 *Project:  Day1Lab

 *Programmer:  Mrs. B.

 *Date:  October 2, 2023

 *Program Name:  Hello.java

**************************************/

What does this do?

a)

It is a list of who made changes and when those changes were made to the program

b)

Tells the program where to get or send information needed to run the program

c)

Tells the program where to start running. This part of the code runs first

d)

The name of the class. This is linked to the ___.java folder with the same name.

9.

import java.io*;

What is this?

a)

A change log

b)

A link to the input output Java subfolder

c)

The main method

d)

The name of the program

10.

import java.io*;

What does this do?

a)

It is a list of who made changes and when those changes were made to the program

b)

Tells the program where to get or send information needed to run the program

c)

Tells the program where to start running. This part of the code runs first

d)

The name of the class. This is linked to the ___.java folder with the same name.

11.

public class Hello

What is this?

a)

A change log

b)

A link to the input output Java subfolder

c)

The main method

d)

The name of the program

12.

public class Hello

What does this do?

a)

It is a list of who made changes and when those changes were made to the program

b)

Tells the program where to get or send information needed to run the program

c)

Tells the program where to start running. This part of the code runs first

d)

The name of the class. This is linked to the ___.java folder with the same name.

13.

public static void main (String[ ] args)

What is this?

a)

A change log

b)

A link to the input output Java subfolder

c)

The main method

d)

The name of the program

14.

public static void main (String[ ] args)

What does this do?

a)

It is a list of who made changes and when those changes were made to the program

b)

Tells the program where to get or send information needed to run the program

c)

Tells the program where to start running. This part of the code runs first

d)

The name of the class. This is linked to the ___.java folder with the same name.

15.

{

}

What are these?

a)

French curly braces

aka. Squiggles

b)

Output statements

c)

Literal print

What the program will output.

d)

Literal print (New line at end)

What the program will output.

16.

System.out.println("This is a literal print.");

System.out.println("Go Java!");

What are these?

a)

French curly braces

aka. Squiggles

b)

Output statements

c)

Literal print

What the program will output.

d)

Literal print (New line at end)

What the program will output.

17.

System.out.println("This is a literal print.");
System.out.print("Yea!");
System.out.println("Go Java!");

What are these?

a)

French curly braces

aka. Squiggles

b)

Output statements

c)

Literal print

What the program will output.

d)

Literal print (New line at end)

What the program will output.

18.


System.out.print("Yea!");

What is this?

a)

French curly braces

aka. Squiggles

b)

Output statements

c)

Literal print

What the program will output.

d)

Literal print (New line at end)

What the program will output.

19.


System.out.print("Yea!");

What does this do?

a)

Tells the program parts when to start and when to stop

b)

Creates what the user of the program will see

c)

Will write the text in between the "..." in the program.

There will be no space or no new line after this text.

d)

Will write the text in between the "..." in the program.

There will be a new line after this text.

20.


{

}

What do these do?

a)

Tell the program parts when to start and when to stop

b)

Creates what the user of the program will see

c)

Will write the text in between the "..." in the program.

There will be no space or no new line after this text.

d)

Will write the text in between the "..." in the program.

There will be a new line after this text.

21.


System.out.println("This is a literal print.");
System.out.print("Yea!");
System.out.println("Go Java!");

What do these do?

a)

Tell the program parts when to start and when to stop

b)

Creates what the user of the program will see

c)

Will write the text in between the "..." in the program.

There will be no space or no new line after this text.

d)

Will write the text in between the "..." in the program.

There will be a new line after this text.

22.


System.out.println("This is a literal print.");

System.out.println("Go Java!");

What do these do?

a)

Tell the program parts when to start and when to stop

b)

Creates what the user of the program will see

c)

Will write the text in between the "..." in the program.

There will be no space or no new line after this text.

d)

Will write the text in between the "..." in the program.

There will be a new line after this text.