Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

The OOP Quiz

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which of these is not one of the primary principles of object-oriented programming?

a)

Encapsulation

b)

Polymorphism

c)

Generalisation

d)

Inheritance

2.

Why are encapsulation and abstraction important?

a)

They allow you to reuse code

b)

Change implementation details without affecting other code that uses the class

c)

Create other classes that use the same properties and methods

d)

Reduce problems into more manageable parts

3.

How do properties enable a class to meet the goals of encapsulation?

a)

They provide a public way to access a private field

b)

They make all data private

c)

They make all data public

d)

They represent data associated with a class

4.

What type of inheritance does C# support?

a)

Single and Multiple Inheritance

b)

Multiple Inheritance

c)

Single Inheritance only

5.

What is polymorphism?

a)

Where information is hidden

b)

Where information is shared with other classes

c)

The capability of one type to be used like another type

d)

A new class that inherits properties and methods from its parent.

6.

What are the types of control flow statements available in C#?

a)

Sequence, Selection & Iteration

b)

Iteration, Sequence & Jump

c)

Jump, Selection & Sequence

d)

Selection, Iteration & Jump

7.

What is the difference between the while and do statements?

a)

While is bottom-tested do is top-tested

b)

While is top-tested, do is bottom-tested

c)

Do loops may never be executed

d)

While statements will always be executed at least once

8.

How many default cases can a switch statement have?

a)

One

b)

Two

c)

At least one

d)

As many as you need

9.

Which operator is used to concatenate strings?

a)

+

b)

-

c)

/

d)

%

10.

What does the StringBuilder class do?

a)

Makes all strings immutable

b)

Creates temporary strings

c)

Creates mutable strings

d)

Manipulates immutable strings