Evaluate the following code Interfaces.java Create a java program using interfaces to display your textbook information: 1.-
Fantastic news! We've Found the answer you've been seeking!
Question:
Evaluate the following codeInterfaces.java
Create a java program using interfaces to display your textbook information:
1.- Textbook: Title, Author, year of publication, and edition
Important: extra credit will be given (up to 15 points) if you enhance your program to request such info from the user.
Ignore the book as I will add it. I am looking to create this for a library as a powerful search tool but still showcase interfaces and user input (that displays the Title, Author, Year of publication, and Edition).
//Chapter 9: Java Interfaces //Code is based on: https://www.w3schools.com/java/java_interface.asp interface Animal { public void animalSound(); // interface method (does not have a body) public void sleep(); // interface method (does not have a body) } class Cow implements Animal { public void animalSound() { System.out.println("The cow says: moo"); } public void sleep() { System.out.println("The cow sleeps from 7 to 12 hours "); } } class Interfaces { public static void main(String[] args) { Cow myCow = new Cow(); myCow.animalSound(); myCow.sleep(); } }
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Posted Date: