hai,
you please check the following program:
public class ScopeTest
{
private static int i = 100;
public static void main(String[] args)
{
System.out.println("Hello World!");
System.out.println(i);
}
}
Even though the static variable i is private , it is perfectly accessible out side the class. According to my knowledge, private variable should not be accessed out side the class , but how could it happen?
I request you to please provide the answer as early as possible.
regards
Yugandhar Akkaldevi
you please check the following program:
public class ScopeTest
{
private static int i = 100;
public static void main(String[] args)
{
System.out.println("Hello World!");
System.out.println(i);
}
}
Even though the static variable i is private , it is perfectly accessible out side the class. According to my knowledge, private variable should not be accessed out side the class , but how could it happen?
I request you to please provide the answer as early as possible.
regards
Yugandhar Akkaldevi