Java Final Class Example


We cannot extend final class in java. This means if class FinalClass is final, we cannot use extends FinalClass in any other class.

This is example of Java final class

public final class FinalClass {


Cannot Extended

public class SubClass extends FinalClass{

	public static void main(String[] args) {


Compiler will throw error at extends FinalClass The type SubClass cannot subclass the final class FinalClass



Leave a Reply