wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java programming

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Which statement is true about java ?

a)

Java is a sequence-depended programming language

b)

Java is a code dependent programming language

c)

Java is a platform-dependent programming language

d)

Java is a platform-independent programming language

2.

Which component is used to compile,debug and execute the java programs ?

a)

JRE

b)

JIT

c)

JDK

d)

JVM

3.

Which one of the following is not a java feature

a)

Object-oriented

b)

Use of pointers

c)

Portable

d)

Dynamic and Extensible

4.

Which of these cannot be used for a variable name in java ?

a)

Identifier & keyword

b)

Identifier

c)

Keyword

d)

None of the mentioned

5.

Which of the following is not an OOPS concept in java ?

a)

Polymorphism

b)

Inheritance

c)

Compilation

d)

Encapsulation

6.

Which of these are selection statements in java

a)

Break

b)

Continue

c)

For ( )

d)

If ( )

7.

Which of these keywords is used to define interfaces in java

a)

intf

b)

Intf

c)

interface

d)

Interface

8.

Which of the following is a superclass of every class in java ?

a)

ArrayList

b)

Abstract class

c)

Object class

d)

String

9.

Which of these packages contains the exception stack Overflow in java ?

b)

Java.system

c)

Java.lang

d)

Java.util

10.

Which of these statements is incorrect about tread ?

a)

Start() method is used to begin execution of the thread

b)

Run () method is used to begin execution of a thread before start() method in special cases

c)

A thread can be formed by implementing runnable interface only

d)

A thread can be formed by a class that extends thread class

11.

Which of these keywords are used for the block to be examined for exceptions ?

a)

Check

b)

Throw

c)

Catch

d)

Try

12.

Which one of the following is not an access modifier ?

a)

Protected

b)

Void

c)

Public

d)

Private

13.

What is the numerical range of a char data tupe in java ?

a)

0 to 256

b)

-128 to 127

c)

0 to 65535

d)

0 to 32767

14.

When does method overloading is determined?

a)

At run time

b)

At compile time

c)

At coding time

d)

At execution time

15.

When overloading does not occur ?

a)

More than one method with same name but different method signature and different number or type of parameters

b)

More than one method with same name,same signature but different number of signature

c)

More than one method with same name,same signature,same number of parameters but different type

d)

More than one method with same , same number of parameters and type but different signature

16.

What is it called if an object has its own life cycle and there is no owner

a)

Aggregation

b)

Composition

c)

Encapsulation

d)

Association

17.

Method overriding is combination of inheritance and polymorphism ?

a)

True

b)

False

18.

Which of the below is invalid identifier with the main method

a)

Public

b)

Static

c)

Private

d)

Final

19.

How can we identify whether a compilation unit is class or interface from a .class file ?

a)

Java source file header

b)

Extension of compilation unit

c)

We cannot different between class and interface

d)

The class or interface name should be postfixed with unit type

20.

What is use of interpreter ?

a)

They covert bytecode to machine language code

b)

They read high level code and execute them

c)

They are intermediated between JIT and JVM

d)

It is a synonym for JIT