How to work with the abstract key word

An abstract class is a class that can't be instantiated.

You can not create an object directly from an abstract class.

It must create a class to inherit an abstract class, and you can create an object from that class.

An abstract Product class

public abstract class Product
{
private String code;
public String toString()
{
return code;
}
abstract String getDisplayText(); // an abstract method
}

A class that inherits the abstract Product class

public class Book extends Product
{
private String author;
public String getDisplayText(); // implements the abstract method
{
return author;
}
}