Join Regular Classroom : Visit ClassroomTech

Programming in JAVA

Java Coding For Interview

Topic 1 JAVA Topic 1 Topic 2 JAVA Topic 2 Topic 3 JAVA Topic 3 The topics that are covered in this article:1. Inheritance2. Types of Inheritance in Java3. Example of Single Inheritance4. Example of Multilevel Inheritance5. Example of Hierarchical Inheritance6. Order of Constructor Calling7. Method Overriding8. Super in Inheritance9. Super without Inheritance10. Multiple Inheritance

Java Coding For Interview Read More »

Superclass variable can reference a subclass variable in java

A reference variable of a superclass can be assigned a reference to any subclass derived from that superclass. You will find this aspect of inheritance quite useful in a variety of situations. For example, consider the following: Here, weightbox is a reference to BoxWeight objects, and plainbox is a reference to Box objects. Since BoxWeight

Superclass variable can reference a subclass variable in java Read More »

Inheritance in java

Inheritance is the process by which objects of one class can link and share some common properties of objects from another class. Use of inheritance : For Method Overriding (so runtime polymorphism can be achieved). For Code Reusability. Syntax of inheritance : The extends keyword indicates that you are making a new class that derives

Inheritance in java Read More »