wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Review

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.
A variable that holds a whole number
a)
String
b)
boolean
c)
int
d)
float
2.
A variable that holds words
a)
String
b)
boolean
c)
int
d)
float
3.
A variable that holds true or false
a)
String
b)
boolean
c)
int
d)
float
4.
A variable that holds a decimal number
a)
String
b)
boolean
c)
int
d)
float
5.
A variable that holds a character
a)
String
b)
boolean
c)
int
d)
char
6.
if - else statement
a)
a loop that iterates, or repeats, until a condition is met
b)
a loop that iterates, or repeats, for a set number of times
c)
makes a decision based on input
d)
creates spaces in memory that holds elements all of the same types
7.
An object from what class holds input from the user?
a)
System
b)
Scanner
c)
String
d)
Selena
8.
pseudocode is:
a)
order of events
b)
instruction given to a computer by a programmer
c)
paragraphs
d)
writing out a program in regular language before translating it into actual code
9.
single line comments, which the computer doesn't read, start with
a)
//
b)
..
c)
**
d)
uppercase letters
10.
A program cannot run if there is an 
a)
error
b)
exception
11.
Something that may go wrong in the running of the code and might cause it to stop functioning (Ex: a user tries to divide by 0, asks for space 7 when only 5 spaces exist, uses a different type of input than expected, asks to view a file that doesn't exist...) 
a)
error
b)
exception
12.
Which of these moves the cursor to the next line beneath the printed output: 
a)
System.out.print("Hello world.");
b)
System.out.println("Hello world.");
13.
Which of these leaves the cursor on the same line as the printed output: 
a)
System.out.print("Hello world.");
b)
System.out.println("Hello world.");
14.
Java is a high-level language. That means it's
a)
closer to human language
b)
closer to machine language
15.

From where did Java get its name?

a)

Coffee

b)

Book

c)

TV Programme

d)

Initials of the developers of Java

16.

Which company owns Java?

a)

Oracle

b)

Microsoft

c)

Google

d)

Apple

e)

Intel

17.
Which type of data is used to enter the value ("Welcome")?
a)
Text
b)
Characters
c)
String
d)
Boolean
18.
Which type of data is used to enter the value (1234.5)?
a)
Integer
b)
Double 
c)
Char
d)
Void
19.
Which type of data is used to enter the value (True)?
a)
Float
b)
Boolean
c)
Check box
d)
ٍString
20.

We 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

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

Which of the following is NOT a numeric data type

a)

int

b)

double

c)

float

d)

decimal

23.
A variable that holds a character
a)
String
b)
boolean
c)
int
d)
char
24.

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

25.
To concatenate the programmer must: 
a)
have quotations (" ")
b)
use the plus symbol + 
c)
escape sequences (\t\n)
d)
use System.out.print( );