public class vote
{
static int i=0;
static int arr[];
public static void lap()
{
int f=0;
arr=new int[5];
arr[i]=2;
arr[i++];
for(int p=0;p<arr.length;p++)>
{
System.out.println(arr[p]);
}
}
public static void main(
String[]args)
{
vote v=new vote();
v.lap();
}
}
I am getting an error at line 10, invalid expression.Please correct it and tell me, why this error is coming.If i change that line with the following line.
arr[i]++; then i don't get any error.