This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
u can access final varibale in inner class mention your problem correctly
Gaurav Mantro
Ranch Hand
Joined: Sep 08, 2000
Posts: 61
posted
0
Inner class can't declare static member variables unless they are static final why ? ------------------ http://www.mantrotech.com
Dave Terrian
Greenhorn
Joined: Jun 25, 2000
Posts: 15
posted
0
We can "say, loosely, that the static keyword always marks a 'top-level' construct (variable, method, or class), which is never subject to an enclosing instance." "This shows why an inner class cannot declare a static member, because the entire body of the inner class is in the scope of one or more enclosing instances." See here - Dave
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
By definition EVERYTHING that the inner class has, that can be manipulated in any way (is not a constant), must be in relation to an instance of the outer class. So each outer class instance would need to have it's OWN version of the inners static member. But you can't have multiple copies of a static thing. So you just can't do it.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Gaurav Mantro
Ranch Hand
Joined: Sep 08, 2000
Posts: 61
posted
0
Thanks Cindy and Dave. Your explaination helped me to understand the concept. regards Gaurav Mantro ------------------ http://www.mantrotech.com