public non-static & non-final allowed | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

public non-static & non-final allowed

text says "it may only contain public static final variables" but eclipse let's me create a "default int count" for example

26th Jan 2017, 2:36 PM
Phil
Phil - avatar
2 Answers
0
Do you have any other information to help us to have a better understanding of your problem, plz. Like the class with the specific line.
26th Jan 2017, 3:36 PM
Florian Castelain
Florian Castelain - avatar
0
ooh i got it now. well eclipse let's me write interface xyz{ public String name = "phil"; } what i noticed just now is that interface fields will implicitly be final and static
26th Jan 2017, 5:21 PM
Phil
Phil - avatar