Follow Us
Contribute
  • Register

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -24

0 votes
needs a solution for this:

 

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -24
requested 6 years ago by anonymous

1 Solution

0 votes

 

public class Q1
{
public static void main(String[] args)
{  
int [] arr = new int[5];
try
{  
  int a=Integer.parseInt(args[0]); 
int b=Integer.parseInt(args[1]);
int c=Integer.parseInt(args[2]);
int d=Integer.parseInt(args[3]);
int e=Integer.parseInt(args[4]); 
int f=Integer.parseInt(args[5]);   
}
catch(ArrayIndexOutOfBoundsException e)
{  
System.out.println("Masukkan 5 Nombor sahaja!!");  
 
System.out.println("THANK yOU");
 }  
 
solved 5 years ago by anonymous

Related errors

0 votes
0 solutions
0 votes
1 solution
+1 vote
1 solution
0 votes
1 solution
+1 vote
1 solution