Hi!
can anyone tell me why this program is giving compiler error..
class staticvartest1
{
//static int x;
public static void main(
String[] args)
{
static int x=10;//This is causing error
x=x+1;
System.out.println("Hello World!");
System.out.println(x);
}
}
}
However this program runs...
class staticvartest1
{
static int x;
public static void main(String[] args)
{
//static int x=10;
x=x+1;
System.out.println("Hello World!");
System.out.println(x);
}
}
}
gives output of 1
<marquee>Plz help me.......</marquee>