Java Program using final class


In this program, You will learn how to implement final class in Java.


final class Test { }


Example: How to implement final class in Java

Run it Now
final class Main {

     int x = 10;

    void display() {
        System.out.println("x value is :" + x);
    }

    public static void main(String args[]) {
        Main t = new Main();
        t.display();
    }
}

Output:

x value is :10