| Author |
access modifier in loal variables
|
Debashree Halder
Ranch Hand
Joined: Jul 27, 2005
Posts: 81
|
|
Why only 'final' be applied as access modifier in local variables? What is wrong with public,private and protected. Regards, Debashree Halder
|
Debashree Halder<br />SCJP 1.5<br />Washington DC
|
 |
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
|
|
Because no need for other.
|
 |
srikanth reddy
Ranch Hand
Joined: Jul 28, 2005
Posts: 252
|
|
The final modifier is a non-access modifier which can b applied to class,method r variable..the local variable has the scope of only the method itself ...so there is no need for access modifiers like public,private r protected .... thanks & regards srikanth
|
Thanks & Regards<br /> <br />-Srikanth
|
 |
Arulkumar Gopalan
Ranch Hand
Joined: Oct 13, 2003
Posts: 104
|
|
|
because, purpose of final is to declare constant variables.
|
Anbudan & Mahalo,<br />Arul<br /> <br />-Not a sun certified Java professional :-)
|
 |
 |
|
|
subject: access modifier in loal variables
|
|
|