Using th following client class write the class book Public
Solution
BookClient.java
public class BookClient {
public static void main(String[] args) {
Book b = new Book(\"Harry potter and the Goblet of Fire\", \"J. K. Rowling\",074666);
b.display();
}
}
Book.java
public class Book {
private String title;
private String author;
private int isbn;
Book(String title, String author, int isbn){
this.title = title;
this.author = author;
this.isbn = isbn;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public int getIsbn() {
return isbn;
}
public void setIsbn(int isbn) {
this.isbn = isbn;
}
public void display(){
System.out.println(\"Title : \"+title+\"\ Author : \"+author+\"\ ISBN : \"+isbn);
}
}
Output:
Title : Harry potter and the Goblet of Fire
Author : J. K. Rowling
ISBN : 31158
![Using th following client class write the class book. Public class bookclient {public static void main (string [] args) {book b = new book (\ Using th following client class write the class book. Public class bookclient {public static void main (string [] args) {book b = new book (\](/WebImages/23/using-th-following-client-class-write-the-class-book-public-1054932-1761550221-0.webp)
![Using th following client class write the class book. Public class bookclient {public static void main (string [] args) {book b = new book (\ Using th following client class write the class book. Public class bookclient {public static void main (string [] args) {book b = new book (\](/WebImages/23/using-th-following-client-class-write-the-class-book-public-1054932-1761550221-1.webp)