How would you stop a class from class from being derived or
inherited.
Answer Posted / stavan
By Creating class as a private.
It will not allow that class to inherited.
private class A{
// code
}
class B extends A{ // It will not work.
// Code
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What are the 3 principles of oop?
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
Why multiple inheritance is not allowed?
what is difference between class template and template class?
What is ambiguity in inheritance?
What is oops concept with example?
How do you achieve runtime polymorphism?
Can private class be inherited?
How oops is better than procedural?
What is object in oops?
given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy
What is inheritance in simple words?
Why do we use inheritance?
What is polymorphism explain?
what's the basic's in dot net