wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Review 2

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.
Which of these variables holds numbers with a decimal point?
a)
double
b)
int
c)
String
d)
boolean
2.
Which of these variables can hold only whole numbers?
a)
double
b)
int
c)
String
d)
boolean
3.
Which of these variables holds words or characters?
a)
double
b)
int
c)
String
d)
boolean
4.
Which of these variables holds a single character?
a)
double
b)
char
c)
String
d)
boolean
5.
Which of these variables holds true or false?
a)
double
b)
int
c)
String
d)
boolean
6.
An object from what class holds input from the user?
a)
System
b)
Scanner
c)
String
d)
Selena
7.
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
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.
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.");
11.
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.");
12.

block comments, which the computer doesn't read, and begin programs with infortion

a)

//

b)

..

c)

/**

*

**/

d)

uppercase letters

13.

Which means wild card, or 'all the things'?

a)

//

b)

!

c)

*

d)

wc

14.

Which line never changes?

a)

public static void main(String[] args){

b)

public class ThisGame{

c)

Scanner input = new Scanner(System.in);

d)

Boolean AndrewIsHere = false;

15.
Which type of data is used to enter the value ("Welcome")?
a)
Text
b)
Characters
c)
String
d)
Boolean
16.
Which type of data is used to enter the value (1234.5)?
a)
Integer
b)
Double 
c)
Char
d)
Void
17.
Which type of data is used to enter the value (True)?
a)
Float
b)
Boolean
c)
Check box
d)
ٍString
18.
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
19.
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();
20.

Which of the following class is used to read input during execution?

a)

Array

b)

String

c)

Scanner

d)

Main