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

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

Advertisement
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 Tutorials/Questions & Answers:
ArrayIndexOutOfBoundsException
to see how we can catch the exception ArrayIndexOutOfBoundException. ArrayIndexOutOfBoundException is thrown when we have to indicate that an array has been
Advertisements
java - Framework
ArrayIndexOutOfBoundException etc..... u better refer java complete reference
JSP Simple Examples
ArrayIndexOutOfBoundException is thrown when we have to indicate