Core Java Archive
super(): super() is used to access Parent class constructor from the child class. It is used to initialize Parent object from Child. We must use super() method inside the child class constructor only. Call to …
final: It is a keyword or modifier. Final member is constant, hence cannot be modified. Final is used to set restrictions on object updations. We can apply final to class, variable and method. Class is …
Abstraction: Abstraction is the concept of hiding un-necessary details of Object and shows only essential features in communication process. Abstraction describes “What an object can do instead how it does it?”. Abstraction is the “General …
How can we create object for abstract class? Every abstract class need extension(Child class). Extended class must override(implement body) for abstract methods. By instantiating Child class, we can access Parent(abstract) class functionality. How can we …
Can an abstract class be final? If final – cannot be extended If abstract – must be extended Then final & abstract – become illegal combination of modifiers. A method cannot be abstract & final. …
Class: Complete definition of Object (Only Concrete methods are allowed) Abstract class: Partial definition of Object (Both Concrete & Abstract methods are allowed) Interface: Complete specification (declaration) of Object (Only abstract methods …
Relations among class, abstract class & interface: A class can extends another class A class need to implements interface An interface extends another interface All relations among class, abstract class and interface as follows. A …
Multiple inheritance: A class can extends only one class in java. An interface can extends number of interfaces in java. More than one extension is called “multiple inheritance”. Question: Can’t we implement interface without using …
Polymorphism: It is the concept of defining an Object (class) that shows different behavior (methods) with the same Identity. “Poly” means “Many” “Morphism” means “Forms” Java supports… Compile time polymorphism Runtime polymorphism
Compile time polymorphism: It is also called static binding. It is method overloading technique. ‘Method overloading’ refers defining more than one method with the same name but with different signature(arguments). Method overloading can be implemented …