Personal tools
You are here: Home → Comp 170 Introduction to OOP → Lab Materials → Lab7 → Book Class
Document Actions

Book Class

by Mit Patel — last modified 2006-03-02 03:53 PM

BookClass

Click here to get the file

Size 1 kB - File type text/plain

File contents

/**
 * Write a description of class Book here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Book
{
    private BookAuthor author;
    private String title;
    
    public void setTitle(String s) {
        title =s;
    }
    
    public String getTitle(){
        return title;
    }
    
    public BookAuthor getAuthor(){
        return author;
    }
    
    public void setAuthor(BookAuthor a) {
        author =a;
    }
    
    public String print(){
        return ("Title of the book is " + title + " and the name of the " +author.print());
    }
     
}
« October 2027
Su Mo Tu We Th Fr Sa
12
3456789
10111213141516
17181920212223
24252627282930
31
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: