0% found this document useful (0 votes)
6 views

Simple_Book_Class

Uploaded by

Devil Lucifer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Simple_Book_Class

Uploaded by

Devil Lucifer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

import java.io.

*;

class Book
{
private String memberName;
private int isbn;
private String bookName;
private int price;
private String bookAuthor;
private String publication;

Book()
{
this.memberName = "\0";
this.isbn = 0;
this.bookName = "\0";
this.price = 0;
this.bookAuthor = "\0";
this.publication = "\0";
}

Book(String memberName,int isbn,String bookName,int price,String bookAuthor,String publication)


{
this.memberName = memberName;
this.isbn = isbn;
this.bookName = bookName;
this.price = price;
this.bookAuthor = bookAuthor;
this.publication = publication;
}

void display()
{
System.out.println("Member Name :" + this.memberName);
System.out.println("Book ISBN :" + this.isbn);
System.out.println("Book Name :" + this.bookName);
System.out.println("Book Price :" + this.price);
System.out.println("Book Author :" + this.bookAuthor);
System.out.println("Book Publication :" + this.publication);
System.out.println("========================================");
}
};

public class Simple_Book_Class


{
public static void main(String args[])
{
Book b1 = new Book();
b1.display();
Book e2 = new Book("HARI",4567,"HEAD FIRST C",456,"Harry. H. Chaudhary","O\'REILY");
e2.display();
}
}

You might also like