Make this class abstract and add an abstract method to it, called move

computer science

Description

1. Here is Java code to create a chess piece:

a) Make this class abstract and add an abstract method to it, called move. 

b) Take each of the classes from last exercise and have it implement the move method.


The Room class also has an abstract method called open, and another abstract method called close. 


b) Create two concrete classes that are children of the Room class, called Kitchen and Bedroom. 


A concrete class (representing concrete rooms) has 2 additional attributes in addition to the attributes of its parent class. Also, when a concrete class implements the open method, it contains code to print the message “Room [insert number here] opened!” and when it implements the close method, it contains code to print the message “Room [insert number here] closed!” 

Instruction Files

Related Questions in computer science category