wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Grade 11(Quiz 1)

Total questions: 20

Worksheet time: 15mins

Name
Class
Date
1.
It is a blueprint of the instance of a class.
a)
method
b)
object
c)
class
d)
java file
2.
How many objects can be made from a class? 
a)
None, you make classes from objects
b)
one
c)
As many as you want
d)
All of the above
3.

How do you create a variable with the numeric value 5?

a)

float x = 5;

b)

x = 5;

c)

int x = 5;

d)

num x = 5

4.

Which data type is used to create a variable that should store text?

a)

myString

b)

String

c)

Txt

d)

string

5.

How do you insert COMMENTS in Java code?

a)

# This is a comment

b)

/* This is a comment

c)

// This is a comment

6.

Where does a java program start executing instructions from:

a)

class

b)

source file

c)

main method

d)

object

7.
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();
8.
A variable that holds a whole number
a)
String
b)
boolean
c)
int
d)
float
9.
A variable that holds words
a)
String
b)
boolean
c)
int
d)
float
10.
A variable that holds a decimal number
a)
String
b)
boolean
c)
int
d)
float
11.
A variable that holds a character
a)
String
b)
boolean
c)
int
d)
char
12.
What is at the end of a line of code?
a)
#
b)
;
c)
)
d)
>
13.
What does a comment look like in Java?
a)
//comment
b)
\\comment
c)
==comment
d)
\comment
14.

Java is short for "JavaScript".

a)

true

b)

false

15.

How do you insert COMMENTS in Java code?

a)

# This is a comment

b)

/* This is a comment

c)

// This is a comment

16.

Which data type is used to create a variable that should store text?

a)

myString

b)

String

c)

Txt

d)

string

17.

int sum1 = 100 + 50;

int sum2 = sum1 + 250;

int sum3 = sum2 + sum2;

System.out.println(sum3);


What will be the final output?

a)

950

b)

800

c)

sum2sum2

d)

sum1250

18.

Which of the following is assignment operator?

a)

==

b)

=

c)

=+

d)

++

19.

int x = 10;

x = x + 5;

System.out.println(x);


What will be the output?

a)

15

b)

5

c)

55

d)

x5

20.

int x = 5;

int y = 6

int z = 50;

System.out.println(x + y + z);


What will be the output?

a)

61

b)

5650

c)

66

d)

x + y + z