Sunday, 19 September 2010

Building the library in Java

First thing is book...So what does book  have:
public abstract class Book
{
String title_;
String author_;
float price_;
int category_, subCategory_;

public Book (String title, String author, double price, int category, int subCategory)
{
title_ = title;
author_ = author;
price_ = price;
category_ = category;
subCategory_ = subCategory;
}


public String toString()
{
return "Title:"title_+"--Author:"+author_+"--price:"+price_+"--Category:"+category_+"--SubCategory:"+subCategory_;
}
}

No comments:

Post a Comment