Why abstract methods can’t be final in Java..

Satheesh Guduri
2 min readFeb 15, 2021

In this article, we will see what is abstract method, what is the use and why it can’t be final.

Abstract Method:

first of all we should know that, what is the method nothing but behaviour. For example we are creating a pen. To create the pen we need some information like its blue print or a class. It means we create the Pen class first, here we declare pen parameters and behaviours. Parematers are nothing but pen price, weight and height, and behaviour means it should be write on paper.

So, our blueprint is ready to create the object, Now i am going to create a pen which is having paremeters like price is 100,weight is 10gm, height is 20 cm and the behaviour is it should be write in blue color.

Here the abstract method is nothing but the pen will write but dont know which color it has to write with. Abstract method tells you to what it is going to do but don’t know how to do.

Whenever you are using abstract method in your child class you have to override the changes it means you are updating with your behaviour, it means you are telling that pen to write in blue or red color.

Abstract is nothing but the child class will be forcing to implement its parent class methods. It means indirectly you are informing about your object behaviour or method.

Final:

The final keyword says don’t update just use it as it is. It means once the object is created it can’t be modified but you can use it.

So if we do like this final abstract method1( ) it will gives you illegal combination of modifier error.

It means abstract method has to be override(update) and you are restricing the object to update by using the final.

Thanks for reading, if you like my article please appaud.

--

--