Inheritance in java
Inheritance is the process of getting properties from base class to child class. A simple implementation of inheritance is given as follows. Base class : Fruit Child class : Apple Two functions: shape() taste() create a object for child class Apple. Access the two functions using this child class object. // Parent class class Fruit { void shape() { System.out.println("Apple is round"); } } // Child class class Apple extends Fruit { void taste() { System.out.println("Apple is sweet"); } } public class sampleinheritance { public static void main(String[] args) { Apple a1 = new Apple(); a1.shape(); // Method inherited from ...