What can you do to make class available for inheritance but you need to prevent its method to come in inheritance chain?
Submitted by: AdministratorWell, Declare a class with public access specifier and mark all it's method to sealed . As anything which is declared with sealed keyword cannot be inherited.
Submitted by: Administrator
Submitted by: Administrator
Read Online OOP Job Interview Questions And Answers
Top OOP Questions
☺ | What is pure virtual function in OOP? |
☺ | When to use Interface over abstract class? |
☺ | Whats the Difference between Interface and Abstract Class? |
☺ | Can we call a base class method without creating instance? |
☺ | What is Abstract method? |
Top Coding/Programming Categories
☺ | Python Interview Questions. |
☺ | OOP Interview Questions. |
☺ | Software engineering Interview Questions. |
☺ | PHP Interview Questions. |
☺ | VBA (Visual Basic for Applications) Interview Questions. |