import java.util.*;class Food { private String name; public String getFood(String name) { this.name = name; return name; } public Food() { } void serveFood() { System.out.printf("I'm serving s%" , getFood(name)); } }class FoodFactory extends Food { private String name; public String getFood(String name) { return name; } public void setFood(String name) { this.name = name; }}class Solution { public static void main(String[] args) { FoodFactory myFoods = new FoodFactory(); Food food1 = myFoods.getFood("FastFood"); Food food2 = myFoods.getFood("Fruit"); System.out.println("My name is: " + food1.getClass().getName()); System.out.println("My name is: " + food2.getClass().getName()); System.out.println("Our superclass is: " + food1.getClass().getSuperclass().getName()); food1.serveFood(); food2.serveFood(); }}