Question: Write a Java program that has a class named Person with instance variable fields for holding persons name (String), and the birth year (String). Write

Write a Java program that has a class named Person with instance variable fields for holding persons name (String), and the birth year (String). Write a constructor and appropriate accessors and mutators for the classs fields. Next, write a class named Engineer that extends the Person class. The Engineer should have the following members: An attribute for the maximum number of building designs A constructor that initializes all the instance variables (Engineer variables and the inherited variables) A toString method that displays the Engineers attributes Next, write a class named Student that extends the Person class. The Student class should have the following members: An attribute for the number of courses A constructor that initializes all the instance variables A toString method that displays the Students attributes Then write a program that creates three Engineer objects and two Student objects and store them in an ArrayList. Use a loop to display the attribute values of each object in the ArrayList. Also check and display the type of the object in each element of the ArrayList.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!