public class StaticField2{
public static void main(String args[]){
private int x, y; // <<== error 1
for ( y = 0 ; y < 100 ; y++){
x = StaticMethod();
System.out.prin tln(" x = "+x);
}
}
public static int StaticMethod(){
private static int m = 0; // <<== error 2
m = m++;
return m;
}
}
why i can't declare x and y as a private?
why i cant declare m as private static?
New to Java(OOP?) world.
TIA.
--
"If we don't stand together than this is the end"
The Business
public static void main(String args[]){
private int x, y; // <<== error 1
for ( y = 0 ; y < 100 ; y++){
x = StaticMethod();
System.out.prin tln(" x = "+x);
}
}
public static int StaticMethod(){
private static int m = 0; // <<== error 2
m = m++;
return m;
}
}
why i can't declare x and y as a private?
why i cant declare m as private static?
New to Java(OOP?) world.
TIA.
--
"If we don't stand together than this is the end"
The Business
Comment