what are the main underlying concepts of object orientation?
Answer Posted / prasi
Abstraction - Interfaces are the best examples of
abstraction .
Encapsulation - Classes are best examples of encapsulation.
Generally we encapsulate what varies &
we abstract commonalities...
One more thing, You should always subclass for behabiours..
you should never subclass for properties / attributes. If
only properties vary, then you have got to encapsulate them
in somewhere else e.g. in a class or in some collection
object like - Properties in Java / Map
Hope this helps..
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
Describe inheritance and non-inheritance of a derived class?
Can you create an instance of an abstract class?
What is the difference between an error and an exception?
What is virtual?
What are abstract classes?
What's the benefit of using inheritance?
Explain serialization and overriding?
Why are virtual users created?
What is the difference between a virtual method and an abstract method?
What is the difference between an Abstract class and Interface?
Explain what is meant by polymorphism?
What is static polymorphism?
What is data abstraction? what are the three levels of data abstraction with Example?
Can you use virtual, override or abstract keywords on an accessor of a static property?
Differentiate between data abstraction and encapsulation.