Core Java Archive
Encapsulation: Encapsulation is the concept of protecting object functionality from outside access. Writing data (variables) and code (methods) into a single unit. In the communication world, we should make outer visibility of Object but not …
Default constructor: Compiler adds a zero args constructor with empty body is called default constructor. We can check compiler added code using “javap” command Compiler doesn’t add default constructor when we define any constructor explicitly …
How can we access Non-static members in Java? Answer: Using Object address, we can access. How to access static members in Java? Answer: Either by using class name or by using object address. Why it …
Constructor Chaining: The concept of connecting multiple constructors in Object creation process. this() method is used to call constructor of same class explicitly. this() can access zero args constructor this(parameters) can access args constructor We …
Inheritance: Inheritance is the Concept of defining new Object by reusing the functionality of existing object. Create a class by using the functionality of existing class. Inheritance is used to update (release next version) of …
Single/Simple inheritance: In Parent Child relation, we access the functionality Parent using Child but we cannot access Child functionality using Parent. Accessing Non static functionality: What is the super class of all classes in java? …
Multi-Level inheritance: Accessing class members in more than one level of hierarchy. Using child class object, it is possible to access the complete functionality of all the objects in the hierarchy. In the process of …
Method Overriding: Defining a method in Child with the same name and signature of its Parent class. Advantage of Method overriding: Overriding is the concept of updating the functionality of Parent object from Child. We …
Hierarchical Inheritance: Sharing the properties of Object to multiple child objects. Accessing overridden method of Parent class: Note: In the above application, we create Parent class object separately to call Parent class functionality. In Child …
super: this super It is a keyword It is a keyword It is a pre-defined non static variable It is a pre-defined non static variable It is used to access current object(class) functionality It is …