Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

MPP Quiz I

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.
a)

One Document object has zero or more Paragraph objects.

b)

Two Document objects have zero or more Paragraph objects.

c)

One Document object has only zero Paragraph object.

d)

One Paragraph object has zero or more Paragraph objects.

2.

Choose the best IS-A relationship.

a)

Cat IS-A Bird

b)

Customer is an Account

c)

DigitalWatch IS-A Timepiece

d)

Circle is a Square

3.

A class cannot be inherited if

a)

the class is an abstract class.

b)

all the constructors are private.

c)

all the methods are protected.

d)

no methods/operations are available.

4.
a)

Associated with each Customer, there is exactly one ShoppingCart, and Customer contains a reference to its ShoppingCart.

b)

Associated with each ShoppingCart, there is zero or one Customer, and ShoppingCart contains a reference to its owning Customer.

c)

When new Customer object is created, it is not equipped with a ShoppingCart.

d)

It is possible to add a second ShoppingCart to a Customer object.

5.

The two aspects of a class are data and behavior. This data and behavior are aspects of anything that we encounter in life. They give expression to the reality that life, at its basis, is a field of existence and _________.

a)

intelligence

b)

sleep

c)

rest

d)

awake

6.

Identify the appropriate design pattern for the given code snippet.

a)

Composition

b)

Singleton

c)

Factory method

d)

Builder

7.

Choose the right option in terms of accessibility.

a)

Protected is more visible than default.

b)

Default is more visibile than protected.

c)

Default is less visible than private.

d)

Protected is more visible than public.

8.
a)

One Person can perform multiple roles.

b)

One Person can perform only Staff role.

c)

One Person can perform only Faculty role.

d)

One Person can perform only Student role.

9.

Father of Java

a)

James Gosling

b)

James Cameron

c)

Guido van Rossum

d)

Ken Thompson

10.

Dependency shows

a)

temporary relationship

b)

permanent relationship

c)

aggregation

d)

composition