Object Oriented Programming Quiz – II

0%

We Can Inherit all Members Of A Class

Correct! Wrong!

No, we cannot inherit private members of a class because private members are accessible only to that class and not outside that class.

Can You Allow A Class To Be Inherited, But Prevent A Method From Being Overridden In C#?

Correct! Wrong!

Yes. By Declaring the class public and making the method sealed.

Can we Execute 2 Catch Blocks?

Correct! Wrong!

No, we can't! Whenever, an exception occurs in your program, the correct catch block is executed and the control goes to the finally block.

What is true statement about Dispose() Method

Correct! Wrong!

Dispose method will be used to free unmanaged resources like files, database connection etc. hence To clear unmanaged resources we need to write code manually to raise dispose() method.

What is true statement about Finalize() Method

Correct! Wrong!

Finalize method also free unmanaged resources like database connections, files etc. We need to implement this method whenever we have unmanaged resources in our code and make sure these resources will be freed when garbage collection process done.

What is polymorphism?

Correct! Wrong!

polymorphism is the provision of a single interface to entities of different types or the use of a single symbol to represent multiple different types.

If the same message is passed to objects of several different classes and all of those can respond in a different way, what is this feature called?

Correct! Wrong!

Its Run time Polymorphism, which allows the same message is passed to objects of several different classes and all of those can respond in a different way, what is this feature called?

Encapsulation is the way to add functions in a user defined structure.

Correct! Wrong!

we can’t call these structures if member functions are involved, it must be called class. Also, it is not just about adding functions, it’s about binding data and functions together.

What is abstraction?

Correct! Wrong!

Data abstraction is the process of hiding certain details and showing only essential information to the user.

In which access modifier should a constructor use, so that object of the class can be created in any function?

Correct! Wrong!

The constructor function should be available to all the parts of the program where the object is to be created. Hence it is advised to define it in public access so that any other function is able to create objects.

Object Oriented Programming Quiz – II
Beginner You need to brush up your oops concepts
Intermediate Good, but there is work to be done!
Pro Good Job!