Difference between object oriented object based programming language

I do not want my class inherited by other class then What should I do ?

Answer : Define class with final keyword. Please see below:

final class Test {
	static void testMethod() {
		System.out.println("Multiple class test");
	}
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *