Yea this is a basic Try and Catch error. I am deeepply sorry if this is just a simple question and im wasting your time, but why does it give me the error for IO Exeption "UnReachable IO Exeption" in my code. Again Im really sorry if this wasted your time but will lovee it if you can help me! Thanks! And tell me if there are any other errors i have to be aware of thanks! (BTW i want the error to come!)
import java.io.IOException;
public class Examples1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] myNums = {1,2,3};
try{
for(int i=0; i<=4;i++){
System.out.println(myNums[i]);
}
} catch(IOException e){
System.err.println("IndexOutOfBoundsException: " + e.getMessage());
}
}
}