 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Is final method inherited in Java?
No, we cannot override a final method in Java.
The final modifier for finalizing the implementations of classes, methods, and variables.
We can declare a method as final, once you declare a method final it cannot be overridden. So, you cannot modify a final method from a sub class.
The main intention of making a method final would be that the content of the method should not be changed by any outsider.
Example
 class Demo{ public final void demoMethod(){ System.out.println("Hello"); } } public class Sample extends Demo{ public final void demoMethod(){ System.out.println("demo method"); } public static void main(String args[]){ Sample obj = new Sample(); obj.demoMethod(); } }   Output
 C:\Sample>javac Sample.java Sample.java:8: error: demoMethod() in Sample cannot override demoMethod() in Demo public final void demoMethod(){ ^ overridden method is final 1 error Advertisements
 