I have the same error in every code I run on Eclipse IDE or on Notepad, Also it was not earlier. In this code I also having same error which I mentioned below
Code:
package WorkJava;
public class TypeCast{
public static void main(String ar[]) {
int sum=0;
for(int i=0;i<5;i++) {
int a=Integer.parseInt(ar[i]);
sum=sum+a;
}
System.out.println("the sum="+sum);
}
error:-
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at WorkJava.TypeCast.main(TypeCast.java:1