Sunday, 19 September 2010

Person class

Now there are persons who borrow book from library...and there are also the person who give the books, i.e librarian.
So we can implement abstract class
package person;

public class Person {
    String name_;

    public Person (String name)
    {
        name_ = name;
    }
   
    public String toString()
    {
        return "Name:"+name_;
    }

    public String getDetails() {
        // TODO Auto-generated method stub
        return "Name: "+name_;
    }


}

No comments:

Post a Comment