Given the following code: public class TestExceptions{ public static void main( String[] args ){ for( int i=0; true; i++ ){ System.out.println("args["+i+"]="+ args[i]); } } } Compile and run the...


Given the following code:


public class TestExceptions{


public static void main( String[] args ){


for( int i=0; true; i++ ){


System.out.println("args["+i+"]="+


args[i]);


}


}


}


Compile and run the TestExceptions program. The output should look like this:


javac TestExceptions one two three


args[0]=one


args[1]=two


args[2]=three


Exception in thread "main"


java.lang.ArrayIndexOutOfBoundsException: 3


 at TestExceptions.main(1.java:4)



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here