The extends keyword is used in a class declaration to specify the superclass of the class being defined. The class being defined has access to all the public and protected variables and methods of the superclass (or, if the class being defined is in the same package, it has access to all non- private variables and methods). If a class definition omits the extends clause, its superclass is taken to be java.lang.Object.