Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Activity 1 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Activity 1_____________________________________________ Class person, student and teacher Create a new Java project with three classes plus another class to test the logic in your code. The main classes of the program are the following classes: Person Student Professor The Student and Teacher classes inherit from the Person class. The Student class will include a public Study() method that will write I'm studying on the screen. The Person class must have two public methods Greet() and SetAge(int age) that will assign the age of the person. The Teacher class will include a public Explain() method that will write I'm explaining on the screen. Also create a public method ShowAge() in the Student class that writes My age is: x years old on the screen. You must create another test class called StudentProfessorTest with a Main method to do the following: Create a new Person and make him say hello Create a new Student, set an age, say hello, and display her age on the screen. Create a new Teacher, set an age, say hello and start the explanation.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

More Books

Students also viewed these Databases questions

Question

Draw the line of best fit on the scatter diagram.

Answered: 1 week ago

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago