Java Fundamentals - OOPs - Interview Questions
Why Object oriented programming?
* Following OOPs programming style allows programmers to provide maintainability and flexibility to the software they write.
* In a typical software company many developers collaborate and work on piece of code that is more likely being used / modified by others.
Encapsulation:
* Over a period of time, you don't like something and want to change a portion of it. The ability to make such change without mandating other unwanted changes in the system reveals how good your design is.
* The ability to make changes in your code without breaking the code of others who use your code, is a key derivative of Encapsulation.
* Java support OO methodology doesn't mean whatever you write is following OO. You need to know basic design principles of OO and implement it in your program to benefit from it.
* Good OO design dictates that you plan for the future.
Inheritance:
* Almost every class in Java adopts inheritance. E.g. Every class extends Object.
* Why inheritance?
- Promote code reuse
- To use polymorphism (Need to simply this word)
* How to achieve inheritance?
- Try to create more generic classes keeping in mind to create more specialized classes out..
What is Inheritance?
* Following OOPs programming style allows programmers to provide maintainability and flexibility to the software they write.
* In a typical software company many developers collaborate and work on piece of code that is more likely being used / modified by others.
Encapsulation:
* Over a period of time, you don't like something and want to change a portion of it. The ability to make such change without mandating other unwanted changes in the system reveals how good your design is.
* The ability to make changes in your code without breaking the code of others who use your code, is a key derivative of Encapsulation.
* Java support OO methodology doesn't mean whatever you write is following OO. You need to know basic design principles of OO and implement it in your program to benefit from it.
* Good OO design dictates that you plan for the future.
Inheritance:
* Almost every class in Java adopts inheritance. E.g. Every class extends Object.
* Why inheritance?
- Promote code reuse
- To use polymorphism (Need to simply this word)
* How to achieve inheritance?
- Try to create more generic classes keeping in mind to create more specialized classes out..
What is Inheritance?
Comments
Post a Comment