class Book
{
String title;
String author;
float price;
int cat, subCat;
public Book (String t, String a, int c1, int c2, float p)
{
title = t;
author = a;
price = p;
cat = c1;
subCat = c2;
}
public String details ()
{
return title+", "+author+" Category "+cat+"."+subCat+" value $"+price;
}
public String toString()
{
return "Title <"+title+"> Author <"+author+"> cat:"+cat+" subCat:"+subCat+" price:"+price;
}
}
A java blog with a collection of examples and tutorials on Java and related technologies. (Under maintenance with continuous updates) Be in touch with java jazzle or k2java.blogspot.com.
Showing posts with label conventions. Show all posts
Showing posts with label conventions. Show all posts
Sunday, February 27, 2011
General way of making class : Book
Subscribe to:
Posts (Atom)