Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Day 2 Wipro

Total questions: 20

Worksheet time: 20mins

Name
Class
Date
1.

Which of the following concepts means "wrapping up of data and methods"?

a)

Inheritance

b)

Encapsulation

c)

Abstraction

d)

Polymorphism

2.

Which concept of OOP is used for code reusability?

a)

Inheritance

b)

Encapsulation

c)

Polymorphism 

d)

Abstraction

3.

Which of the following allows runtime method binding?

a)

Static polymorphism

b)

Function overloading

c)

Dynamic polymorphism

d)

Method hiding

4.

Which keyword is used to call the constructor of a superclass?

a)

super

b)

this

c)

extends

d)

base

5.

Which of these cannot be used to achieve polymorphism?

a)

Method overloading

b)

Method overriding

c)

Constructor overloading

d)

Variable hiding

6.

Which modifier makes a variable accessible in subclasses only?

a)

private

b)

protected

c)

public

d)

default

7.

Which keyword is used to prevent method overriding?

a)

static

b)

private

c)

final

d)

abstract

8.

Which concept hides internal implementation from the user?

a)

Inheritance

b)

Abstraction

c)

Polymorphism

d)

Overloading

9.

What is the base class of all classes in Java?

a)

java.base

b)

java.lang.Object

c)

System

d)

Main

10.

Which interface should a class implement to become threadable?

a)

Runnable

b)

Callable

c)

Cloneable

d)

Threadable

11.

What is the size of an int variable in Java?

a)

2 bytes

b)

4 bytes

c)

8 bytes

d)

Depends on OS

12.

Which of the following can be used to terminate a loop in Java?

a)

break

b)

continue

c)

exit

d)

end

13.
  1. What is the output of:

java

System.out.println(3 + 5 + "7");

a)

87

b)

357

c)

12

d)

75

14.

Which keyword is used to define a constant in Java?

a)

static

b)

const

c)

final

d)

immutable

15.

Which statement is true about switch in Java?

a)

It can only be used with integers

b)

It cannot use String values

c)

It can be used with char and String

d)

It always requires default

16.

Which of these is not a Java keyword?

a)

static

b)

interface

c)

unsigned 

d)

volatile

17.

Which of the following correctly declares an array in Java?

a)

int arr[] = new int(5);

b)

int arr[] = new int[5];

c)

int arr = new int[5];

d)

int arr() = new int[5];

18.

Which of the following allows multidimensional arrays in Java?

a)

int[][] arr = new int[3][4];

b)

int arr = new int[3,4];

c)

int[3][4] arr;

d)

int arr(3)(4);

19.

What is the output?

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

System.out.println(a.length);

a)

0

b)

2

c)

3

d)

Compilation error

20.

Can arrays in Java hold objects?

a)

No

b)

Yes, only Strings

c)

Yes, any type of object

d)

Only primitive types