Originally posted by ankana mukherjee:
this does not compile but if this is written within a method
this compiles.why?
well this has nothing to do with final.even just a simple int instance variable will also give the same error if declared 1st and then initialized in another line which is also inside an instance variable exclusive scope.In general any instance variable, if not initialized when it is declared, then can be done so only with an instance of the that class.or at least that's what i guess...i am also guessing there are cases when this may not be true!
[ September 03, 2008: Message edited by: jolly good ]