Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please create a java program that base on the picture. also include UML diagram for each class. and a description of the program in your

image text in transcribed

image text in transcribed

please create a java program that base on the picture. also include UML diagram for each class. and a description of the program in your own words.

1- Create a dass called Mobile Device with a poivate fidld device Type that will be initialized to the string 2- Create another class SmartPhone that will inhenit MobileDevice, with a private field deviceType Mobile Device for in the constructor Include the coresponding setter and getter methods nitialized to the string Smart Phone Your Name in the constructor, and oveide the getter method by retuming the string: "Mobile Device > Smart Phone CHint: To obtain this result make a call to the super class getter method) Smart Phonent To obitain this esalt makr a call to the super class getter 3 Create three more classes: Android, iPhone, and Windows Phone that will inherit SmartPhone, have a private field device Tpe initialized to the string "Android "iPhone" or Windows Phones correspondingly in the constructor, and override the getter method returning the corresponding string Mobile Device - Smart Phone iPhone for iPhone, "Mobile Device Smart PhoneAndroid for Android", or Mobile Device > Smart Phone Your classes must follow this hierarchy Windows Phone" for Windows Phone. MobileDevice SmartPhone Android iPhone Windows Oace you create the dasses, run the following dient code and report your output public class MobileDeviceClient pnblie statie void main (Stxsng sxRs) t TODO Auth-generated aethod stub Android myAndtoad new Android KindowsPhone mykindowsPhonee HandossPhone.) Syatem.out.rintia (muMobileDevace.setbegicetipe System.out.pxintin (aySmarsPhone gstDeiriceType 0) system.ouapzintin v Phone.getDesacet

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

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

Distinguish between a mortgage and a notc. AppendixLO1

Answered: 1 week ago