wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PreTrainingWeek3Content

Total questions: 11

Worksheet time: 9mins

Name
Class
Date
1.

Which of the following is not included in the exceptions hierarchy?

a)

Throwable

b)

Exception

c)

Serializable

d)

Error

2.

What are the two main classifications of exceptions? (pick 2)

a)

Runtime

b)

Compile Time

c)

Build Time

d)

Deploy Time

3.

Which of the following is not an example of Polymorphism?

a)

Method Overriding

b)

Method Overloading

c)

Method Chaining

d)

Object Casting

4.

Which of the following is not a pillar of OOP

a)

Polymorphism

b)

Polydactylism

c)

Inheritance

d)

Abstraction

5.

What is the basic purpose of Encapsulation?

a)

Hiding complexity of implementation

b)

Controlling access to states and behaviors

c)

Providing a relationship between classes

6.

Suppose you have an ArrayList called intList.

Which of the following returns the second element from intList?

a)

intList.pop(1);

b)

intList.peek(1);

c)

intList.get(1);

d)

intList.get(0);

7.

Which of the following would NOT be considered valid?

a)

A try block

A catch block

and

A finally block

b)

A try block

and

A finally block

c)

A catch block

and

A finally block

d)

A try block

and

A catch block

8.

Which keyword is used to make a class inherit from another?

a)

inherits

b)

extends

c)

implements

d)

uses

9.

variables declared in an interface are implicitly...

a)

public static final

b)

protected final

c)

private static

d)

public abstract

10.

Suppose the Dog class extends Animal.

The bark() method is defined in the Dog class.

Which code snippet will produce an error?

a)
b)
c)
11.

Upcasting is done _____

Downcasting is done _____

a)

Explicitly, Implicitly

b)

Implicitly, Explicitly

c)

manually, automatically

d)

first, second