Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Java by (6.5k points)
Do interfaces behave differently than normal classes?

1 Answer

0 votes
by (11.3k points)
No, we cannot do that and doing that would completely defeat the purpose of interfaces in the first place. Declaring anything as final makes it non-overridable by any class that implements or extends the container interface or class.

The purpose of an interface it to declare final data members and provide a set of methods to any class that implements the interface and define the function as the class needs it to be implemented, which is, in a way, overriding those methods present in the interface. Hence, it is not possible if we want to implement an interface.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...