Home Answers Viewqa Java-Interview-Questions ArrayIndexOutOfboundException

 
 


Nagendran
ArrayIndexOutOfboundException
1 Answer(s)      a year and a month ago
Posted in : Java Interview Questions

whis is the ArrayIndexOutOfbound Exception in java? or define ArrayIndexOutOfbound Exception with exp?

View Answers

March 28, 2012 at 11:34 AM


ArrayIndexOutOfbound Exception occurs, when you assign an array which is not compatible with the data type of that array.

Example

public class ArrayoutofboundException {

  public static void main(String[] args) {
  try {
  System.out.println("args[0]="+args[0]);
  System.out.println("args[1]="+args[1]);
  System.out.println("args[2]="+args[2]);
  }
  catch(Exception ex){
  System.out.println(ex);
  }
  }
  }









Related Pages:
ArrayIndexOutOfBoundsException
can catch the exception ArrayIndexOutOfBoundException. ArrayIndexOutOfBoundException is thrown when we have to indicate that an array has been accessed
java - Framework
ArrayIndexOutOfBoundException etc..... u better refer java complete reference
JSP Simple Examples
ArrayIndexOutOfBoundException is thrown when we have to indicate

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.