Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

illegal start of expression

 
prashantK Singh
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

class s
{
public static void main(String[] a){
static int i;
System.out.println(i);
}
}

why this is showing illegal start of expression
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The keyword static cannot be applied to local variables.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic