Final class in Java

JavaJava Programming Java 8

The main purpose of using a class being declared as final is to prevent the class from being subclassed. If a class is marked as final then no class can inherit any feature from the final class.

public final class Test {
   // body of class
Published on 02-Feb-2018 15:53:54