Notes
Abstract Class Example
Content of the notes (1)
Page 1
public abstract class Shape implements Comparable
{
private String name;
//constructor
public Shape (String n)
{
name= n;
}
//accessor
public String getName()
{
return name;
}
//methods
public abstract double area();
public abstract double perimeter();
public abstract int compareTo(Shape s);
}
Information
- Description
- Example of Java abstract class
- Created by
- joannazhang13 · May 2015
- Updated
- Feb 20, 2016
- Views
- 58
- Tags
- Rating