Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Add an interface named Displayable. This interface should contain a single metho

ID: 3531566 • Letter: A

Question

Add an interface named Displayable. This interface should contain a single method named getDisplayText that returns a String. Edit the Product class so it implements the Displayable interface. The getDisplayText method in this class should format a string that can be used to display the product information. Edit the Employee so it implements the DepartmentConstant and Displayable interfaces. The getDisplayText method in this class should work like the one in the Product class, and it should use the constants in the DepartmentConstant interface to include the department name in the return value. Open the DisplayableTestApp class and add code to it that creates an Employee object, assign it to a Displayable variable, and displays the information in the Employee object at the console. To get the information for an employee, you'll need to use the method of the Displayable interface. Run the application to make sure that it displays the employee information. Repeat Steps 6 and 7 for a Product object. Open the DislayableTestApp class add a method with this signature: private static String displyMultiple(Displayabled, int count) Write the code for this method so it returns a string that contains the Displayable parameter the number of times specified by the int parameter. Modify the code in the main method so it uses the displayMultiple method to display the employee information once and the product information twice. Run the application to make sure it works correctly. DisplayableTestApp.java, Employee.java, Product.java, DisplayableConstants.java, Displayable.java

Explanation / Answer

class prod implements Displayable

{

String str="string";

str=obj.getDisplayText(str);

System.out.println(str);

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote