How would you stop a class from class from being derived or
inherited.
Answer Posted / anant tiwari
There are three way to stop a class been derived (example in C#)
1) declare a class as static (Ex : static class Sample {....}
2) declare the class constructor as private (Ex class Sample{ private Sample(){}....}
3) declare a class as sealed class Ex : sealed class Sample {...}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
What are oops functions?
what is different between oops and c++
What is interface in oop?
is there any choice in opting subjects like 4 out of 7
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< What is the renewal class? Is html an oop? Why do we use inheritance? What are the features of oop? write a program to find 2 power of a 5digit number with out
using big int and exponent ? explain sub-type and sub class?
atleast u have differ it into 4 points? Why do while loop is used? Why is static class not inherited? What is persistence in oop?