wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Lesson 11

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

Which of the following is NOT a data types in java

a)

int

b)

String

c)

number

d)

double

2.

Which of the following is NOT a NON-primitive data type

a)

String

b)

Array

c)

double

d)

class

3.

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

4.

x /= 3


Which of the below statements matches with above statement?

a)

x = 3 / x

b)

x = x / 3

c)

x / 3

d)

x /x = 3

5.

What is the output of below code?


int x = 5;

System.out.println(x++);

System.out.println(x);

a)

5

5

b)

6

6

c)

5

6

d)

6

5

6.

A variable that holds true or false

a)

String

b)

boolean

c)

int

d)

float

e)

Alex Trebek

7.

Which declaration will throw an error?

a)

double num = 8;

b)

int averageGrade = 89.7;

c)

boolean done = false;

d)

String done = "true";

8.

In Java, execution starts from ___________ function.

a)

get()

b)

main()

c)

java()

d)

display()

9.

Java is

a)

platform dependent

b)

platform indeprndent

10.

Operator used to access the members of a class /package

a)

(.) Dot

b)

(,) Comma