wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Test-1

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

Which of the following is not a Java features?

a)

Dynamic

b)

Architecture Neutral

c)

Use of pointers

d)

Object-oriented

2.

Evaluate the following Java expression, if x=3, y=5, and z=10:

++z + y - y + z + x++

a)

24

b)

23

c)

20

d)

25

3.

All Java components require names. Names used for classes, variables, and methods are called?

a)

Variables

b)

identifiers

c)

Access Modifiers

d)

Java Modifiers

4.

Which of the following is not a primitive data type ?

a)

byte

b)

enum

c)

short

d)

int

5.

Character data type cannot store following value.

a)

Digit

b)

Letter

c)

Special Character

d)

String

6.

Modulus operator, %, can be applied to which of these?

a)

Both Integers and floating - point numbers

b)

Integers

c)

Floating - point numbers

d)

None of the mentioned

7.

Evaluate the value of the expression?

6 - 2 + 10 % 4 + 7

a)

14

b)

12

c)

13

d)

10

8.

Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative?

a)

((x < 100) && (x > 1)) && (x < 0)

b)

((x < 100) && (x > 1)) || (x < 0)

c)

(1 > x > 100) || (x < 0)

d)

1 < x < 100 || x < 0

9.

Which of the following is used to declare,construct, and initlaize an array?

a)

int arr [] [] = {1, 2, 3, 4};

b)

int [] arr = (1, 2, 3)

c)

int [] arr = {};

d)

int arr [] = {1, 2, 3};

10.

In java, array elements are stored in ________ memory locations

a)

Random

b)

Sequential

c)

Sequential & Random

d)

Binary search