<<< Abstract Classes | Index | Concrete class >>> |
public abstract class Product
{
private String code;
private String description;
private double price;
// regular constructors and methods for instance
// variables
@Override
public String toString()
{
return "Code: " + code + "\n" +
"Description: " + description + "\n" +
"Price: " + this.getFormattedPrice()
+ "\n";
}
// an abstract method
abstract String getDisplayText();
}//class Product
<<< Abstract Classes | Index | Concrete class >>> |