write a class that satisfies the PersonDriver: The class will contain the following: An abstract Person class
Question:
write a class that satisfies the PersonDriver: The class will contain the following: An abstract Person class that contains one abstract method "public abstract String doesForALiving()" An interface named Drinks that contains one abstract method "public abstract String drinks()" Create three additional classes all of which extends and implements Person and Drinks. > Student > Instructor >Hipster A Student returns "STUDENT: I spend all my time studying" for doesForALiving(); A Student returns ""STUDENT: I drink Red Bull" for drinks() An Instructor returns "INSTRUCTOR: I spend all my time teaching" for doesForALiving(); An Instructor returns "INSTRUCTOR: I drink coffee" for drinks() A Hipster returns "HIPSTER: I spend all my time grooming" for doesForALiving(); A Hipster returns "HIPSTER: I drink " for drinks() Output should be: STUDENT: I spend all my time studying STUDENT: I drink Red Bull INSTRUCTOR: I spend all my time teaching INSTRUCTOR: I drink coffee HIPSTER: I spend all my time grooming HIPSTER: And I drink High Noon
2-Look atWristWatch.javaDownload WristWatch.javaand examine the main method. Complete this class by doing the following to make the main method work: A WristWatch has a brand (String) and a cost (double) Create atwo-argumentconstructor Implement the Comparable interface and overload the compareTo method OverloadthetoString method Output should be: Timex: 44.5 Apple: 369.0 Omega: 700.0 Tag Heuer: 1520.5 Rolex: 10499.0
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch