Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

1. Write down two or three of your greatest strengths.

Answered: 1 week ago

Question

What roles have these individuals played in your life?

Answered: 1 week ago

Question

2. Write two or three of your greatest weaknesses.

Answered: 1 week ago