Using Java
Use the UML diagram given to create the 3 classes and methods.
The class "House" is an abstract class. The methods "forSale()" and "location()" are abstract methods in the House class.
The "forSale" method returns a String that states the type of villa or apartment available. For example: "1 bedroom apartment".
The "location" method is of type void and prints in the output the location of the villa and apartment. For example: "The villa is in Corniche".
Finally, create a test class. In the test class, make two different objects called "house1" and "house2" and print the "forSale" and "location" method for apartment and villa.
Use the UML diagram given to create the 3 classes and methods. The class "House" is an abstract class. The methods "forSale()" and "location()" are abstract methods in the House class. The "forSale" method returns a String that states the type of villa or apartment available. For example: "1 bedroom apartment". The "location" method is of type void and prints in the output the location of the villa and apartment. For example: "The villa is in Corniche". Finally, create a test class. In the test class, make two different objects called "house1" and "house2" and print the "forSale" and "location" method for apartment and villa.
House
+forSale(): String
+location(): Void
Apartment
+toString(): String
Villa
+toString(): String