Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

please solve asap(java program) Class Diagrams Person String name: private int age; +Person(String n, int a) Person +Retare +static void sayHit SOP Hi from Person);

please solve asap(java program) image text in transcribed
image text in transcribed
Class Diagrams Person String name: private int age; +Person(String n, int a) Person +Retare +static void sayHit SOP "Hi from Person"); 1 Benefit Faculty private double salary; + double getSalary: Student double pa private String id; +Student(String n, int a double s Stringi) Student Students + Student +Betpal + int getBenefits) { return 20;1 Benefit VisitingFaculty Exchange +int getBenefits/{ return 100;} Senior String capstone; RetCapstone) + static void sayi SOP("Hi from Senior": + int getBenefits() {retum super.getBenefits)+30) H) Write a toString method for the Student class=> Name:#**# Age: ID:**** (2 marka) 1) Write a toString method for the Senior class using super > Name: Age:### ID:##### Capstone: (2 marks) (3 marks) J) Make an equals method for the Student class. Equal if gra and age are the same. You must override the Object equals method. Don't use super (no equals in parent class)

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_2

Step: 3

blur-text-image_3

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

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students explore these related Databases questions