Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exchange e = new Exchange(); System.out.println( e.getBenefits() ); => e.sayHi(); => Person[] pA = { new Senior(), new Faculty() } ; System.out.println( pA[0].getBenefits() ); =>

image text in transcribed

Exchange e = new Exchange();

System.out.println( e.getBenefits() ); =>

e.sayHi(); =>

Person[] pA = { new Senior(), new Faculty() } ;

System.out.println( pA[0].getBenefits() ); =>

pA[0].sayHi(); =>

For each line, answer A) compiler error B) run-time error C) no problems

Person p1 = new Student( ); =>

  1. Student s1 =p1 ; (Note: p1 is from question M) =>
  2. Exchange e1 = (Exchange)p1; (Note: p1 is the object from question M) =>
Class Diagrams Person String name; private int age; +Person(String n, int a) +Person() +getAge() +static void sayHiO) SOP("Hi from Person"); } Benefit Student Faculty private double salary: double spa; +double getSalary(); private String id; + Student(String n, int a, double g, String i) + Student( Students) + Student() + getGpa) + int getBenefits() { return 20; } Benefit Visiting Faculty +int getBenefits() { return 100; } Exchange Senior String capstone; + getCapstone() + static void sayHi({ SOP("Hi from Senior"); + int getBenefits() { return super.getBenefits()+30)

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

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago