1. Inheritance
2. Polymorphism
3. Abstraction
4. Encapsulation
Inheritance allows a Child class to inherit properties from its parent class. In Java this is achieved by using extends keyword. Only properties with access modifier public and protected can be accessed in child class.
Polymorphism is briefly decsribed as "one interface, many implementations". Polymorphism is a characteristic of being able to assign a different meaning or usage to something in different contexts - specifically, to allow an entity such as a variable, a function, or an object to have more than one form.
Abstraction refers to the act of representing essential features without including the background details or explanations.
Encapsulation is a technique used for hiding the properties and behaviours of an object and allowing outside access only as appropriate. It prevents other objects from directly altering or accessing the properties or methods of the encapsulated object.
There are two types of polymorphism one is Compile Time Polymorphism and the other is Run time Polymorphism
Through method overloading (i.e. methods having same name but different type or number of arguments)
Through method overriding, to pe precise, it is called Dynamic Method Dispatch (i.e. which method to call, either of base class or child class, this is resolved at run time, based on the reference passed or assigned to the object)
Overriden methods must have the same name, argument list and return type.
Yes. You can have any number of main methods with different method signature and implementation in the class.