Create an interface named Turner, with a single method called turn(). Then create 4 classes:
1 - Leaf: that implements turn(), which changes the color of the Leaf object and returns true. If for any reason it is unable to change color, it should return false (you can come up with a reason for failure). The new color can be determined at random.
2 - Document: that implements turn(), which changes the page on the document to the next page and returns true. If the current page is the last page of the document, then it returns false. This class should have a method called returnIdDate(), which returns a String containing the ID of the Document and the date it was published.
3 - Pancake: that implements turn(), which flips the pancake if it has not flipped before and returns true. If the pancake has already been flipped, then it returns false.
4 - Think of one more objects that can use turn(). Create the class and implement the turn() method. Show your creativity.
These should be complete classes with appropriate fields and methods (setters, getters, toString, and equals method)
Write an application, DemoTurners, which creates an array of 4 Turner objects and adds one object of each of these class types to it. Then demonstrate polymorphism by calling the turn() method on each object in a loop. Then print the Document object’s returnIdDate method using the Turner object.
NOTE: You need to show the polymorphism aspect of Interfaces.
*Attached Document is the same
50 freelancers estão ofertando em média $21 para este trabalho
Contact me for an efficient, perfect, well documented development of your project according to 100% accuracy and requirements, with dedicated support. Thanks
Hi there, I've read your document. I can do this task within some hours. Pls check my page to get more info about me (passed exams, previous custome reviews, exp, ...). Let me help you! Best regards, Duc Nguyen
Hi there. I am senior developer from Vietnam. I have been working on this site for 2 years. I am interested in your [url removed, login to view] let's me help you.
Hi, 7+ years expert java programmer. I can handle your task very well. I hope I shall not disappoint you if you choose me. Best Regards, Khalid Hafeez