 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can prevent method overriding using final keyword. Before starting, you can note my information. You can subscribe my YouTube channel by clicking on the link which is available at bottom right corner of this video. You can download my app Techimage that is available on Google Play. You can connect with me by following other details which are available in front of you. Now coming on to the topic, here I will be writing some instructions which will demonstrate you how you can prevent method overriding in Java with the help of final keyword. Suppose there is a class K in which I have defined a public method whose name is show. Inside this method, I am using system.out.println and it is displaying hello on screen. Now I am implementing class B which is extending class A. So here class A is superclass for class B and class B is subclass. Now in this class, I am defining show method and inside system.out.println, I am writing by as a text. So you can see that here no errors are displayed till now. It means method overriding is successful in this case. Now if you want to prevent method overriding, so you can apply final keyword inside superclass method. So here superclass is A and method which is overridden that is show. So I have declared this show method as final. Now if I inherit class A into class B and if I try to override show method, then compiler will show an error message. You can see that an error message available here which is saying cannot override the final method from A. So friends, if you want to prevent method overriding, then you can declare a particular method as final in the class and if that class is inherited further into another classes, then final will prevent method overriding for a particular method. So this way you can prevent method overriding in Java. If you understood or if you want to see or watch more programming related videos, you can subscribe my YouTube channel. You can connect with me by following other details which are available in front of you. Thank you for watching this video.