How to Use Final Class in Java


In this example, we will learn the method to use final class in Java.

Source Code

package com.beginner.examples;

final class FinalClass { // final class
  public static void main(String[] args) {
    System.out.println("OK");
  }
}

Output:

OK
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments