Can abstract classes have static and final methods? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can abstract classes have static and final methods?

28th Apr 2016, 3:50 PM
Neelesh I
Neelesh I - avatar
1 Answer
+ 5
Methods inside an abstract class are abstract. Methods cannot both be static and abstract because they are two different access modifiers for the method. Additionally, if you declare an abstract class, you can declare a final method, however, it cannot be both abstract and final at the same time. Hope this helps. :)
24th Jun 2016, 12:32 AM
Scylla
Scylla - avatar