How can stop method overriding?

We can stop the method overriding by declaring method as a final. The example is as suppose that there is method called method1(), then we write it as:

final void method1();
Thus the method1() will not be overridden.

0 comments :

Post a Comment