Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

Local Variables and Access Modifiers
access mdifiers also use with the local variables .like : 
class Foo {
void doStuff() {
private int x = 7;
this.doMore(x);
}
}
           Here we appy local variable Final in the terms of access modifiers.
Visibility                 |Public|Protected|Default|Private
---------------------------------------------------
From the same class                 |yes |yes      |yes    |yes
---------------------------------------------------
From any class in the same package       |Yes|Yes|Yes|No
--------------------------------------------------
From any non-subclass class outside the package        |Yes|No|NO|NO
---------------------------------------------------
From a subclass in the same package                |Yes|Yes|Yes|No
--------------------------------------------------
From a subclass outside the same package                |Yes|Yes|No|No
Posted By: Name:Rajesh Kr URL: Local Variables and Access Modifiers