<prompt> Provide a valid example of using inheritance in the Java language  <response>: Inheritance is an OOP concept in Java, which allows the creation of a subclass derivedchild class from a superclass parentbase class. The subclass inherits all the properties and behaviors of the superclass, and can also have additional properties and behaviors of its own. Heres an example:java Defining a superclass Animal class Animal String name; int age; Constructor public AnimalString name, int age this.name name; this.age age; public void eat System.out.printlnthis.name is eating.; public void makeNoise System.out.printlnthis.name is making some noise.; Defining a subclass Dog class Dog extends Animal String breed; Constructor public DogString name, int age, String breed supername, age; calling the superclass constructor this.breed breed; public void wagTail System.out.printlnThe dog is wagging its tail.; overriding the makeNoise method Override public void makeNoise System.out.printlnThe dog is barking.; ---public class Main public static void mainString args Creating a Dog object Dog dog1 new DogScooby, 5, Great Dane; System.out.printlndog1.name is a dog1.breed , who is dog1.age years old.; dog1.eat; dog1.makeNoise; dog1.wagTail; Output:Scooby is a Great Dane, who is 5 years old.Scooby is eating.The dog is barking.The dog is wagging its tail.In this example, Animal is the superclass, and Dog is its subclass. Dog extends Animal, meaning it inherits all the properties and methods of the Animal class. In the Dog class, we have added an additional property breed and an additional method wagTail. We have also overridden the makeNoise method to give it a different implementation.When we create a Dog object in the main method, we can access and use all the properties and methods of 