please help
Define a java structure (code) that can represent Smartphone. It must have a model attribute. Smart Phone must have send Message method. By default, sendMessage displays the text "Message sent". A general Smartphone should not be able to be instantiated. Define also two classes, Android Phone and iOSPhone that are SmartPhones. Both classes should define the model attribute and features of a SmartPhone. In each class, the sendMessage method specify the source mobile in the displayed message. (ie Message sent from Android phone) For common SmartPhone features, define a structure SmartPhoneFeature that indicates SmartPhone common feature like camera method. Both Android Phone and iOSPhone have camera. The specific behavior when instances of either class Camera is to display for: Android Phone object: "13MP camera" IOSPhone object: "8Mp camera". Instances of either AndroidPhone or IOSPhone should be able to be stored in a variable of type SmartPhone Feature.
please help
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am