+ 2

Can method be private and abstract at the same time?

2nd Sep 2018, 1:35 PM
saurabh sable
saurabh sable - avatar
4 odpowiedzi
+ 15
Java: The answer is No. Keyword abstract cannot be used for methods that are static, final or private,  as methods with these modifiers cannot be overridden.
2nd Sep 2018, 4:45 PM
LukArToDo
LukArToDo - avatar
+ 13
saurabh sable You're welcome 😉
2nd Sep 2018, 4:50 PM
LukArToDo
LukArToDo - avatar
+ 3
LukArToDo thank you
2nd Sep 2018, 4:49 PM
saurabh sable
saurabh sable - avatar
+ 1
nope it can be protected though
3rd Sep 2018, 7:17 PM
Aarav Raj
Aarav Raj - avatar