1. What is OOP ?
- OOP ( Object Oriented Programming) is a programming paradigm based on the
concept of “objects”and “class” .
- OOP focus on manipulating objects rather than logic
- Make code manageable , reusable ,and maintainable
- OOP is based on following priciples:
+ Encapsulation
+ Abstraction
+ Inheritance
+ Polymorphism
- Encapsulation :
+ All important information is contained inside an object and only select
information is exposed
+ The implementation and state of each object are privately held inside a
defined class
+ Other objects do not have access to this class or the authority to make
change. They are only able to call list of public methods
+ This characteristic of data hiding provides greater program security and
avoid unintended data corruption
- Abstraction :
+ Objects only reveal internal mechanisms that are relevant for the use of
other objects
+ Hiding any unnecessary implementation code
+ The derived class can have its functionality extended
+ This concept can help devs more easily make additional changes or
additions over time
- Inheritance :
+ Classes can reuse code from other classes
+ Relationships and subclasses between objects can be assigned ,
enabling devs to reuse common logic while still maintaining a unique
hierarchy
+ This property of OOP forces a more thorough data analysis , reduces
development time and ensures a higher level of accuracy
- Polymorphism:
+ Objects are designed to share behaviors and they can take on more than
one form
+ The program will determine which meaning or usage is necessary for
each execution of that object from a parent class , reducing the need to
duplicate code
+ Child class is then created , which extends the functionality of the parent
class
+ Polymorphism allows different type of objects to pass through the same
interface
2. Difference between abstract class and interface ?
- Used for abstraction
- Methods :
+ Interface can only have abstract methods
+ Abstract class can have at least one abstract method ,and method , prop
like normal class
- Variable:
+ Interface : default final , only static and final
+ Abstract class : may contain - non final variables , can have final/non -
final , static/ non - static variables
- Abstract class : “is - a” when subclass extend ab class want to have all
characteristic from ab class
- Interface : “has - a “ a contract , want class is able to do , class have to override
all methods interface have
3. Difference between overriding and overloading ?
- Overloading: Same name different params in same class
- Overriding : Save method signature in both super class and child class
4. Difference between array and array lists ?
5. What is the static / final keyword ?
Static : the value is the same for every i
6. Join SQL ?
7. GROUP BY , HAVING ?
8. Stream API , Lambda expression ?
9. Access modifier ?
10. RestfulAPI ?
11. Collection ,generic type ?