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
What is the use if instanceof keyword? And how do refer to a current instance of object?
Can an interface implement or extend another interface?
Can you tell something about GDI objects?
What is a constructor in class?
Explain serialization and overriding?
What is the difference between an error and an exception?
What are the interfaces you used in beans?
Do structs support inheritance?
What are the features of encapsulation ?
What's the order of call of constructors in inheritiance?
What is the diffrence between an abstract class and interface?
What do you mean by polymorphism?
How many methods are there in the serializable interface?
How many methods are there in the externalizable interface?
Explain about overriding polymorphism?