Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Fundamentals

Total questions: 17

Worksheet time: 9mins

Name
Class
Date
1.

What is the keyword "final" used for in Java?

a)

identify a constant

b)

identify an integer

c)

identify a string

d)

Identify a final answer

2.

The keyword "method" is another name for

a)

an object

b)

a class

c)

a function

d)

a variable

3.

Java was originally named:

a)

Coffee

b)

Oak

c)

New C++

d)

Duke

4.

Which of the following is NOT a numeric data type

a)

int

b)

double

c)

float

d)

decimal

5.

Which of the following is incorrect?

a)

int count = 50.0;

b)

int salary = 50_000;

c)

int salary = 50_00;

d)

all of these are incorrect

6.

The numeric type int uses how many bits?

a)

31

b)

32

c)

63

d)

64

7.

Which of the following is an example of a reference variable declaration?

a)

int count;

b)

String name;

c)

float gpa;

d)

char firstInitial;

8.

Where does a java program start executing instructions from:

a)

class

b)

source file

c)

main method

d)

object

9.
We are use Scanner Library in java for...
a)
Give permissions to the user
b)
Correcting software errors
c)
Allows user to read data
d)
Allows the user to enter data
10.
When we want to print in Java, we use the code ......
a)
system.out.print();
b)
System.out.println();
c)
System.Out.Printf();
d)
System.out.show();
11.
A variable that holds a whole number
a)
String
b)
boolean
c)
int
d)
float
12.
A variable that holds words
a)
String
b)
boolean
c)
int
d)
float
13.
A variable that holds a decimal number
a)
String
b)
boolean
c)
int
d)
float
14.
A variable that holds a character
a)
String
b)
boolean
c)
int
d)
char
15.
What is at the end of a line of code?
a)
#
b)
;
c)
)
d)
>
16.
These controls the behavior of a program.
a)
class
b)
object
c)
method
d)
void
17.
What does a comment look like in Java?
a)
//comment
b)
\\comment
c)
==comment
d)
\comment