Though the concepts were correct, When I tried that program
it showed me the error
D:\ecom\java\bin>javac EnterValuesFromKeyboard.java
D:\ecom\java\bin>java EnterValuesFromKeyboard
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at EnterValuesFromKeyboard.main(EnterValuesFromKeyboard.java:14)
how can you solve this ERROR?
import java.io.*;
public class Progress_Report
{
static public void main(String args[])throws IOException
{
int i,j,count=0;
int marks[]=new int[7];
float avg;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
for(i=1;i<=3;i++)//No Of Students
{
int total=0;
System.out.println("Enter Marks Of One Student "+i);
for(j=1;j<=6;j++)//No Of Subjects
{
System.out.println("Enter The Marks Of Subject "+j);
marks[j]=Integer.parseInt(br.readLine());//Here its denying input less than three digit
total=total+marks[j];
while(marks[j]<35)
{
count=count+1;//No Of Failed Subjects
}
}
avg=(total/6);
System.out.println("Total Of Student "+i+" is "+total);
System.out.println("Average Of Student "+i+" "+avg);
System.out.println("No Of Subjects Failed "+count);
}
}
}
Thanks In Advance....Hope You Reply Me Fast....Mail Me : binnujesudasan@gmail.com
wen i executed dis program, i got an error tat is "exception in thread "main" java.lang.ArrayIndexOutOfBoundsException"...
why it is showing error like dat ??? pls explain dis..
Hi,
I'm only a beginner at Java.
Running the program as it is given in the example, I get an exception (here after). Can you explain me why please?
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at EnterValuesFromKeyboard.main(EnterValuesFromKeyboard.java:14)
Error on that ExampleMurugan.M June 27, 2011 at 2:33 AM
Though the concepts were correct, When I tried that program it showed me the error D:\ecom\java\bin>javac EnterValuesFromKeyboard.java D:\ecom\java\bin>java EnterValuesFromKeyboard Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at EnterValuesFromKeyboard.main(EnterValuesFromKeyboard.java:14) how can you solve this ERROR?
ses of public,protected,local variable in javaneelam agrawal July 4, 2011 at 8:25 PM
pls provide all the information abt dis ....
Java Program-Progress ReportBinnu Jesudasan Gudapati July 29, 2011 at 10:42 AM
import java.io.*; public class Progress_Report { static public void main(String args[])throws IOException { int i,j,count=0; int marks[]=new int[7]; float avg; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); for(i=1;i<=3;i++)//No Of Students { int total=0; System.out.println("Enter Marks Of One Student "+i); for(j=1;j<=6;j++)//No Of Subjects { System.out.println("Enter The Marks Of Subject "+j); marks[j]=Integer.parseInt(br.readLine());//Here its denying input less than three digit total=total+marks[j]; while(marks[j]<35) { count=count+1;//No Of Failed Subjects } } avg=(total/6); System.out.println("Total Of Student "+i+" is "+total); System.out.println("Average Of Student "+i+" "+avg); System.out.println("No Of Subjects Failed "+count); } } } Thanks In Advance....Hope You Reply Me Fast....Mail Me : binnujesudasan@gmail.com
parseInt().sumudu April 18, 2012 at 9:52 AM
thanx dear
dodo@rocketmail.comhaha April 25, 2012 at 5:39 AM
so nice bro.
javachinnu July 4, 2012 at 1:51 PM
wen i executed dis program, i got an error tat is "exception in thread "main" java.lang.ArrayIndexOutOfBoundsException"... why it is showing error like dat ??? pls explain dis..
Exceptionmari September 12, 2012 at 8:35 PM
Hi, I'm only a beginner at Java. Running the program as it is given in the example, I get an exception (here after). Can you explain me why please? Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at EnterValuesFromKeyboard.main(EnterValuesFromKeyboard.java:14)
Change the user input to integerAmrita January 21, 2013 at 1:28 PM
This code is not working...I am getting Array index out of bounds exception
Post your Comment