You can prevent others from extending your class by making it final using the keyword final in the class declaration. The keyword final may appear after or before the access modifier. For example:
public final class Pencil
final public class Pen
You are currently reading a PREVIEW of this book.
Get instant access to over
$1 million worth of books and videos.