Create these classes in JAVA First class: private String first; private String last; //Constructor Author(String first,
Posted: Thu Jul 14, 2022 2:10 pm
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
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