Java. Can final variable be non-static? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Java. Can final variable be non-static?

16th Mar 2018, 1:10 PM
Габелая Егор
Габелая Егор - avatar
3 Answers
+ 2
when it is not static, you have to create an instance to access it https://code.sololearn.com/c3j6k2cf4fbU/?ref=app
16th Mar 2018, 2:49 PM
michal
0
yes, it can be final int a=11;
16th Mar 2018, 2:18 PM
michal
0
but it doesnt work
16th Mar 2018, 2:34 PM
Габелая Егор
Габелая Егор - avatar