Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Object Oriented Programming

Total questions: 54

Worksheet time: 32mins

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.

Method overriding is combination of inheritance and polymorphism ?

a)

True

b)

False

46.

Which of the below is invalid identifier with the main method

a)

Public

b)

Static

c)

Private

d)

Final

47.

Also known as the library. It is a collection of related classes and interfaces that have been grouped together into a folder.

a)

Class

b)

Inheritance

c)

Interface

d)

Package

48.

The extends keyword is used. This is the process of getting properties from one class to another - one way of organizing classes.

a)

Class

b)

Inheritance

c)

Interface

d)

Package

49.

It has characteristics or attributes. The values of an object's attributes give the object a state.

a)

Object

b)

Class

c)

Inheritance

d)

Interface

50.

A program component that contains the heading for a number of public methods.

a)

Object

b)

Class

c)

Inheritance

d)

Interface

51.

It defines a kind of object; it is a blueprint for defining the object.

a)

Object

b)

Class

c)

Inheritance

d)

Interface

52.

The programming methodology that defines objects whose behavior and interactions accomplish given task.

a)

Orient-Object Programming

b)

Oriented-Object Programming

c)

Object-Oriented Programming

d)

Object-Object Programming

53.

An interface is used by another class through the ________ keyword.

a)

gives

b)

provides

c)

implements

d)

orders

54.

Package used to scan input from the user.

a)

import java.util.Scan;

b)

import java.util.*;

c)

import java.util.Get;

d)

import java.util.Scanner;