scope of variables java
- by qxc
Is a variable inside the main, a public variable?
public static void main(String[] args) {
.........
for(int i=0;i<threads.length;i++)
try {
threads[i].join();
} catch (InterruptedException e) {
e.printStackTrace();
}
long time=0;
....
}
i and time are they both public variables?
Of course if my reasoning is correct, also any variable belonging to a public method should be considered public.. am i right?
Thanks