ca9 please bid only if you know you can score 100
Instructions:
Write a Java program called to demonstrate Inheritance and Polymorphism
- Create a base class called Person, that has fields, constructors, and anything else you think you may need as you go along. It should also have a method called speak(), to make the person say their name (using System.out.println) (1 point)
- Create any two subclasses of the Person class. Each subclass must have the following:
- At least one new field, with getter/setter methods (1 point)
- A default constructor that sets its fields to default values, and also all the fields of it’s base class to default values (1 point)
- A parameterized constructor that accepts all fields from both the base (Person) and new subclass fields (1 point)
- A speak method, that says something specific that an object of that class would say. (make it up) (1 point)
- In a main method, create a Person object, and one object of each subclass (2 objects), and stick all 3 objects in either an ArrayList or an array. Then just loop through (iterate) the ArrayList or array, and call the speak method for each object (1 point)
NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.
Do you need a similar assignment done from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code "save15" for a 15% Discount!
Request essay helpYou can trust us for this and even for your future projects