consider the person class below it has two members variables name and age it also ha 5195946

Consider the Person class below. It has two members variables name and age. It also has two constructors and two methods getInfo and getAge. The default constructor (that does not take any argument) sets the name of the person to “Unknown”. class Person { String name; int age; public Person(){ name = “Unknown”; } public Person(String newName, int newAge){ name = newName; age = newAge; } public void increaseAge() { age = age + 1; } public void getInfo(){ System.out.println(“Name: “+ name+” age: “+age); } } You can inherit from Person class using the extends keyword. class SuperHero extends Person { String fictionalName; String superPower; public SuperHero(String originalName, int newAge, String nickName, String newSuperPower){ name = originalName; age = newAge; fictionalName = nickName; superPower = newSuperPower; } public void save(){ System.out.println(fictionalName+” “+superPower+” and saves the day!”); } public void getInfo(){ System.out.println(“Ficitional Name: “+fictionalName+ ” Super Power: “+superPower); } } This class is similar to other classes we have seen except for the extends keyword and the class name Person. Person is the base class or parent class for SuperHero class. SuperHero is called the subclass of Person. SuperHero defines fictionalName and superPower variables. It also defines a new method save. It also overloads getInfo method from the super class. SuperHero does not define name and age, but sets them in the constructor. This is valid since, name and age are non-private members of Person. In general any sub class can access non-private members (both variables and methods) of a super class. But super class can not access any variable newly defined at a subclass. SuperHero <———————-> Person Sub Class Super Class —————————- | Class | —————————- | Variables | —————————- | Constructors | —————————- | Methods | —————————- Organization of a Class —————————- | Sub Class | —————————- | Super Class | | Variables | —————————- | Variables | —————————- | Constructors | —————————- | Super Class | | Methods | —————————- | Methods | —————————- Organization of a subclass public class Inhertiance1 { public static void main(String[] args) { Person p1 = new Person(“Harry Potter”, 19); // What does this line do? SuperHero h1 = new SuperHero(“Peter Parker”, 20, “Spider”, “spins web”); // What does this line do? System.out.println(; // What does this line do? System.out.println(p1.age); // What does this line do? System.out.println(; //Member from super class System.out.println(h1.age); // What does this line do? System.out.println(h1.fictionalName); // What does this line do? System.out.println(h1.superPower); // What does this line do? System.out.println(p1.superPower); // What does this line do?; // What does this line do?; // What does this line do? p1.getInfo(); // What does this line do? h1.getInfo(); // What does this line do? } } p1 is a reference to Person, h1 is a reference to SuperHero. Through h1 you can access name and age, which are members of the super class. Run this program and observe the relationship between super class and sub class. There are some bugs, you can comment them out and continue with running the program. Your task will be to explain what any line of code does, during submission. You can copy all the code snippets and paste them in a single file

"Get 15% discount on your first 3 orders with us"
Use the following coupon

Order Now