Why do local inner classes not allow static variables ? The static fields of the classes could at least have been allowed access from the local method ?
daudiam -6 Junior Poster
Recommended Answers
Jump to PostWhy do local inner classes not allow static variables ? The static fields of the classes could at least have been allowed access from the local method ?
Because static members make little sense when it comes to "local inner classes" since these classes belong to a scope as opposed …
Jump to PostBut like we normally have static fields in a normal class (there are so many uses of them), why can't we benefit from them in their local class ?
Do you have any scenario in mind which can be handled properly *only* if local inner classes are allowed to have …
All 5 Replies
pbl 22 Junior Poster
lcy320stud 0 Newbie Poster
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
daudiam -6 Junior Poster
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.