Question
I do assignment for java which is write a program for book with the main class it's work but with 4 errors in cmd in
I do assignment for java which is write a program for book with the main class it's work but with 4 errors in cmd in print method
public String getAuthor()
{
return author;
}
public String getTitle()
{
return title;
}
public int getNumberOfPages()
{
return numberOfPages;
}
public int getIsbn()
{
return isbn;
}
public void displayBook()
{
System.out.println("Book Author:"+Author);
System.out.println("Book NumberOfPages:"+NumberOfPages);
System.out.println("Book Title:"+Title);
System.out.println("Book Isbn:"+Isbn);
}
}
and this is the main class
public class TestBook
{
public static void main(String args[])
{
Book book1=new Book();
Book book2=new Book();
Book book3=new Book();
book1.setAuthor("Dr. Franc Morino");
book1.setNumberOfPages(202);
book1.setTitle("My Story");
book1.setIsbn(1122554);
book2.setAuthor(" Lady Gaga");
book2.setNumberOfPages(10);
book2.setTitle("Cool by The Pool");
book2.setIsbn(1122554);
book3.setAuthor(" D.J. Khaled");
book3.setNumberOfPages(10);
book3.setTitle("Hot By The Spot");
book3.setIsbn(1122554);
System.out.println("--------------------------------");
book1.displayBook();
System.out.println("--------------------------------");
book2.displayBook();
System.out.println("--------------------------------");
book3.displayBook();
System.out.println("--------------------------------");
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started