wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Displaying Data & Data Types

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

Which one is correct?

a)

public static main(Strings[] args) { }

b)

public private static main(Strings[] args) { }

c)

public static void main(Strings[] args) { }

d)

public void static main(Strings[] args) { }

2.

How would you declare a variable that tells you that someone passed a class?

a)

boolean passed = 'true';

b)

boolean passed = true;

c)

passed = true;

d)

String passed = "true";

3.

How would you declare a variable storing the tax rate?

a)

int taxRate = 5.1;

b)

taxRate = "5.1";

c)

double taxRate = 5.1;

d)

double taxRate = "5.1";

4.

What data type would you use for storing the average test score in a class?

a)

boolean

b)

char

c)

int

d)

double

5.

What data type would you use for storing the number of students in a class?

a)

boolean

b)

char

c)

int

d)

double

6.

What data type would you use for storing the average test score in a class?

a)

boolean

b)

char

c)

int

d)

double

7.

Name the data type: 1.0

a)

double

b)

int

c)

char

d)

boolean

8.

This data type returns true or false

a)

String

b)

boolean

c)

char

d)

int

9.
Which type of data is used to enter the value (1234.5)?
a)
Integer
b)
Double 
c)
Char
d)
Void
10.
Which type of data is used to enter the value (True)?
a)
Float
b)
Boolean
c)
Check box
d)
ٍString
11.
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();
12.
What does a comment look like in Java?
a)
//comment
b)
\\comment
c)
==comment
d)
\comment