This is my code tell me where I went wrong because I keep getting no output on console and in my eclipse does not show any error just a yellow line. package postu;
This is my code tell me where I went wrong because I keep getting no output on console and in my eclipse does not show any error just a yellow line.
package postu;
public class krazy {
public static void main(String [] args){}
private String name;
private String author;
private String publisher;
private long ISBN;
public void Book() {
this.name=name;
this.ISBN=ISBN;
this.author=author;
this.publisher=publisher;
}
public void setName(String name) {
this.name= name;
}
public void setAuthor(String author) {
this.author= author;
}
public void setISBNnumber(long ISBN) {
this.ISBN= ISBN;
}
public void setPublisher(String publisher) {
this.publisher= publisher;
}
public String getName() {
return name;
}
public String getAuthor() {
return author;
}
public long getISBN() {
return ISBN;
}
public String getPublisher() {
return publisher;
}
public void setBooksInfo(String name,String author,String publisher,long ISBN)
{
this.name=name;
this.ISBN=ISBN;
this.author=author;
this.publisher=publisher;
}
public void getBooksInfo() {
{
System.out.println("Book Name:" + name);
System.out.println("ISBN Number.:" + ISBN);
System.out.println("Author:" + author);
System.out.println("Publisher:" + publisher);
}
}
}
Description of the Problem:
Supposed you are assigned as a programmer in a University Library. You were asked to create a program that provides information about their book collections. A Book has four pieces of information: book name, an ISBN number, an author name and a publisher. Information about this book can be provided by the user using a setter method and these can be accessed using getter methods. Inaddition, provide a method named getBookInfo that returns the description of the book as a String (the description should include all the information about the book).
Construct a class Book based on the description and a program to test your class. Create just one book object.
Step by step
Solved in 3 steps with 1 images