wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Object Oriented Programming/ Java Essentials Pre-Test

Total questions: 49

Worksheet time: 30mins

Name
Class
Date
1.

Polymorphism related to :

a)

PPO

b)

Class

c)

OPP

d)

OOP

2.

Which from the following is a feature that allows us to perform a single action in different ways.

a)

Abstraction

b)

Polymorphism

c)

Encapsulation

d)

Inheritance

3.

The process by which objects of one class acquire the properties of objects of another class is known as

a)

Polymorphism

b)

Inheritance

c)

Data Hiding

d)

Association

4.
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
5.
What is the difference between a class and an object?
a)
A class is a blueprint to make an object
b)
An object is a blueprint to make a class
c)
A blueprint is an object to make a class
d)
Blueprint class is an object make a
6.
An object is an instance of a:
a)
parameter
b)
method
c)
class
d)
application
7.

Which of the these is the functionality of ‘Encapsulation’?

a)

Binds together code and data

b)

Using single interface for general class of actions

c)

Reduce Complexity

d)

All of the mentioned

8.

What is the main difference between float and double data types?

a)

4.1 is an example of float.

b)

4.11 is an example of double.

c)

Float consists of 8 bytes, and double consists of 4 bytes.

d)

Float consists of 4 bytes, and double consists of 8 bytes.

9.

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

a)

myString

b)

String

c)

Txt

d)

string

10.

How do you insert COMMENTS in Java code?

a)

# This is a comment

b)

/* This is a comment

c)

// This is a comment

11.

Java is short for "JavaScript".

a)

true

b)

false

12.

The value of a string variable can be surrounded by single quotes.

a)

true

b)

false

13.

which one this keywords are used to create a class in java

a)

class

b)

struct

c)

int

d)

none of the avove

14.

which one of the following have elements in insertion order

a)

sorted map

b)

hashmap

c)

linkedhashmap

d)

treemap

15.

which of the following is wrapper class in java

a)

Float

b)

Integer

c)

Double

d)

all of above

16.

Java was originally named:

a)

Coffee

b)

Oak

c)

New C++

d)

Duke

17.

When was Java released?

a)

1975

b)

1985

c)

1995

d)

2005

e)

2015

18.

Who invented Java?

a)

James Gosling

b)

Sergey Brin

c)

Steve Jobs

d)

Bill Gates

e)

Tim Berners-Lee

19.

What was Java originally designed for?

a)

Interactive TV

b)

Internet

c)

Gaming

d)

Cars

20.

Which company owns Java?

a)

Oracle

b)

Microsoft

c)

Google

d)

Apple

e)

Intel

21.

int [] nums = {2, 3, 5, 8, 9, 11};

How would you access the fourth element in nums?

a)

nums[4]

b)

nums[3]

c)

nums(4)

d)

nums(3)

22.

which one of the following is true?

a)

runnable interface declares the start method

b)

Thread.start() method is used to move a thread from a new state to the runnable state

c)

Thread.runnable() method is used to move a thread from new state to the runnable state

d)

Thread.run() method is used to move a thread from new state to the runnable state

23.

Which of the following operator can operate on a Boolean variable?

a)

&&

b)

+=

24.

Out of these methods of the String class, which one can be used for testing the strings for equality?

a)

a. equals()

b)

b. isequal()

c)

equal()

d)

isequals()

25.

Out of these packages, which one contains an abstract keyword?

a)

java.util

b)

java.lang

c)

java.system

d)

java.io

26.

Out of these exceptions, which one is thrown by the compareTo() method that is defined in a double wrapper?

a)

SystemException

b)

ClassCastException

c)

IOException

d)

CastException

27.

Where does the String Pool get stored?

a)

Metaspace

b)

Java Stack

c)

Java Heap

d)

Permanent Generation

28.

Which method can we use in an applet to output a string?

a)

transient()

b)

drawString()

c)

print()

d)

display()

29.

Which method in Java generates boolean random values?

a)

randomBoolean()

b)

nextBoolean()

c)

generateBoolean()

d)

previousBoolean()

30.

. Which mechanism helps in the process of naming as well as visibility control of the classes and their content?

a)

Packages

b)

Interfaces

c)

Object

d)

None of the above

31.

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

32.

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

a)

JRE

b)

JIT

c)

JDK

d)

JVM

33.

Which one of the following is not a java feature

a)

Object-oriented

b)

Use of pointers

c)

Portable

d)

Dynamic and Extensible

34.

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

a)

Identifier & keyword

b)

Identifier

c)

Keyword

d)

None of the mentioned

35.

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

a)

Polymorphism

b)

Inheritance

c)

Compilation

d)

Encapsulation

36.

Which of these are selection statements in java

a)

Break

b)

Continue

c)

For ( )

d)

If ( )

37.

Which of these keywords is used to define interfaces in java

a)

intf

b)

Intf

c)

interface

d)

Interface

38.

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

a)

ArrayList

b)

Abstract class

c)

Object class

d)

String

39.

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

b)

Java.system

c)

Java.lang

d)

Java.util

40.

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

41.

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

a)

Check

b)

Throw

c)

Catch

d)

Try

42.

Which one of the following is not an access modifier ?

a)

Protected

b)

Void

c)

Public

d)

Private

43.

When does method overloading is determined?

a)

At run time

b)

At compile time

c)

At coding time

d)

At execution time

44.

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

45.

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

46.

Method overriding is combination of inheritance and polymorphism ?

a)

True

b)

False

47.

Which of the below is invalid identifier with the main method

a)

Public

b)

Static

c)

Private

d)

Final

48.

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

49.

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