WorksheetsThe OOP Quiz
Total questions: 10
Worksheet time: 5mins
Which of these is not one of the primary principles of object-oriented programming?
Encapsulation
Polymorphism
Generalisation
Inheritance
Why are encapsulation and abstraction important?
They allow you to reuse code
Change implementation details without affecting other code that uses the class
Create other classes that use the same properties and methods
Reduce problems into more manageable parts
How do properties enable a class to meet the goals of encapsulation?
They provide a public way to access a private field
They make all data private
They make all data public
They represent data associated with a class
What type of inheritance does C# support?
Single and Multiple Inheritance
Multiple Inheritance
Single Inheritance only
What is polymorphism?
Where information is hidden
Where information is shared with other classes
The capability of one type to be used like another type
A new class that inherits properties and methods from its parent.
What are the types of control flow statements available in C#?
Sequence, Selection & Iteration
Iteration, Sequence & Jump
Jump, Selection & Sequence
Selection, Iteration & Jump
What is the difference between the while and do statements?
While is bottom-tested do is top-tested
While is top-tested, do is bottom-tested
Do loops may never be executed
While statements will always be executed at least once
How many default cases can a switch statement have?
One
Two
At least one
As many as you need
Which operator is used to concatenate strings?
+
-
/
%
What does the StringBuilder class do?
Makes all strings immutable
Creates temporary strings
Creates mutable strings
Manipulates immutable strings
