Create these classes in JAVA First class: private String first; private String last; //Constructor Author​(String first,

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Create these classes in JAVA First class: private String first; private String last; //Constructor Author​(String first,

Post by answerhappygod »

Create these classes in JAVA
First class:
private String first;
private String last;
//Constructor
Author​(String first, String last)
//method
int compareTo(Author a) //for first and last
String getFirstName()
String getLastName()
String toString
Second class:
private String city;
private String name;
everything else is the same as the first class except thecompareTo method is only forname.
Third class:
//constructor
Book​(String title, String isbn,int pages, String pubName, String pubCity, Author[] array) //pubName and pubCity representing the publisher nameand city in the publisher class
Book​(String title, String isbn,int pages, Publisher pubs, String[] author)
//method
basic getter and setter
toString
Then please create a main that would ask and fill thesecond constructor for the book class (you still need to create thefirst constructor I just don't need you to fillit)
Title
ISBN
Pages
Number of Authors
One Author per line
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply