ERROR - the type cannot subclass the final class

Error

The type "" cannot subclass the final class ""

Error Type 

Compile Time


Sample Code 

public final class FinalTest {
private int element1;
private static String element2 = "Hello";

public static void main(){
element2="World";
}
}

public class Test extends FinalTest {
String element = "Hello";

private void method(){
element = "World";
}
}

Cause

Final Class cannot be sub classed. 

Resolution

Remove Final modifier from the parent class or don't extend it.

public class FinalTest {
private int element1;
private static String element2 = "Hello";

public static void main(){
element2="World";
}
}

public class Test extends FinalTest {
String element = "Hello";

private void method(){
element = "World";
}
}