+ 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