# final Java Keyword

The final keyword may be applied to a class, indicating the class may not be extended (subclassed).

The final keyword may be applied to a method, indicating the method may not be overridden in any subclass.

## Examples

      public final class MyFinalClass
      {
      }

      public class MyClass
      {
         public final String myFinalMethod()
    	 {
    	    <statements>
    	 }
      }

## Remarks

- A class may never be both abstract and final. abstract means the class must be extended, while final means it cannot be.

- A method may never be both abstract and final. abstract means the method must be overridden, while final means it cannot be.

Related Topics

abstract Java Keyword