It is an override, yes but for what?
No, in
InnerFun infun = new InnerFun(){String s;}; , s doesn't override anything. This particular field i.e.
s is useless. It is actually an extra member, but since the actual type of
infun is
InnerFun, and since
s is not a member of
InnerFun, so you cannot use s. But lets say that I was doing something like this
In this particular case, the instance field
val is useful. But this is a fabricated example. I cannot think of any real life use of this. Basically as I said before, the fields in an anonymous inner class can only be accessed by the methods of the anonymous inner class itself. If you can find use of it, then you can use them...