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
Can we use static method definitions in interfaces?
What is composition? Explain the purpose of composition.
What is the difference between an interface and abstract class?
State two differences between an object and a class.
Can you create an instance for an abstract class?
How many methods are there in the externalizable interface?
What are the rules to define a functional interface?
Does a class inherit the constructor of its super class?
Why is java not fully objective oriented?
Explain about realistic modeling?
What is data encapsulation and what is its significance?
Explain about the relationship between object oriented programming and databases?
Does java support multiple inheritance? if not, what is the solution?
Can encapsulation be called as a security device?
Write a note on encapsulation?