Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Recap

Total questions: 15

Worksheet time: 12mins

Name
Class
Date
1.
Which type of data is used to enter the value ("Welcome")?
a)
Text
b)
Characters
c)
String
d)
Boolean
2.
Which type of data is used to enter the value (1234.5)?
a)
Integer
b)
Double 
c)
Char
d)
Void
3.
Which type of data is used to enter the value (True)?
a)
Float
b)
Boolean
c)
Check box
d)
ٍString
4.

What do we use the 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

5.

What do we use a For loop for?

a)

To repeat a specified number of operations.

b)

To repeat a unspecified number of operations.

c)

All answers are correct

6.
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();
7.

Which is used to check for equality between Data types?

a)

=

b)

==

c)

%

d)

||

8.
A way of organizing code and data into objects, rather than independent methods.
a)
class
b)
method
c)
return
d)
object oriented
9.

A variable;

a)

Expresses a true false statement

b)

stores a string, number, or boolean, and gives it a specific, case-sensitive name

c)

takes in an input, does something with it, and then returns an output.

d)

Runs a boolean (true/false) statement based on data entered

10.
Variable names must begin with a lowercase letter and cannot have any spaces.
a)
True
b)
False
11.
Java class names should always begin with an Uppercase letter and with a number.
a)
True
b)
False
12.
To concatenate the programmer must: 
a)
have quotations (" ")
b)
use the plus symbol + 
c)
escape sequences (\t\n)
d)
use System.out.print( );
13.
What is at the end of a line of code?
a)
#
b)
;
c)
)
d)
>
14.
Comments that are enclosed between /* and */. The compiler ignores anything that appears between /* and */.
a)
Single-line comments
b)
Multiple-line comments
c)
comments
15.

IronMan or Thor?

a)
b)