/* This is our Parent superclass. */ public class Parent { String firstName; String lastName; private String favoriteIceCream; Parent(String fn, String ln, String fic) { firstName = fn; lastName = fn; favoriteIceCream = fic; } String getName() { return "Parent is " + firstName + " " + lastName; } String getFavoriteIceCream() { return favoriteIceCream; } void setFavoriteIceCream(String fic) { favoriteIceCream = fic; } } /* This is our Child subclass. */ public class Child extends Parent { private String favoriteVideoGame; Child(String fn, String ln, String fic, String fvg) { super(fn, ln, fic); favoriteVideoGame = fvg; } String getName() { return "Child is " + firstName + " " + lastName; } String getFavoriteVideoGame() { return favoriteVideoGame; } void setFavoriteVideoGame(String fvg) { favoriteVideoGame = fvg; } } /* In this case of inheritance, the subclass Child inherits its name and favorite ice cream attributes and methods from superclass Parent while having its own unique favorite video game attributes and methods. */