"ok if the methods of a final class are final by default why r the variables not final by default" Hmmmm.... I suppose the easy answer is "because they are not." I think you seem to be confusing two concepts: that of const (or constness) and that of final. Perhaps you've programmed in C/C++ before?
In
Java, the
final keyword does more than double-duty. When
final is applied to a class, that class may not be extended. When
final modifies a method, that method may not be overridden. When
final modifies a variable, that variable becomes a "constant variable" (which is truly oxymoronic).
Now back to applying the
final keyword to a class.... Simply by definition, when the
final keyword modifies a class, the class cannot be extended. Because the class cannot be extended, all methods of the class are by default (or implicitly) final. The class's instance variables can still be altered.
Think of some final classes in Java, for example StringBuffer. The StringBuffer class cannot be extended; it is declared as final. The contents of the StringBuffer instance, however, can be changed.