/* This is the child class extends the Name_Age class * */ import java.util.*; public class Name_AgeDemo extends Name_Age { public static void main(String[] args) { Scanner key = new Scanner(System.in); // Gets the name from the user System.out.print("Enter your name: "); String names = key.nextLine(); // Pass the name into setName method setName(names); // Gets the age from the user System.out.print("Enter your age: "); int ages = key.nextInt(); // Pass the age into setAge method setAge(ages); // Prints out the name and age System.out.println(getName() + " is " + getAge() + " years old"); } }