Please copy the full text of the compiler's error message and paste it here.
Type: Posts; User: Norm
Please copy the full text of the compiler's error message and paste it here.
@sainisuresh101 Can you post some code that shows what you are talking about?
@AJAY KAMBLE
Please edit your post and wrap your code with code tags:
YOUR CODE HERE
to get highlighting and...
Please edit your post and wrap your code with code tags:
YOUR CODE HERE
to get highlighting and preserve formatting.
Please copy the full text of the error message and paste it here.
Also post the code and be sure to wrap your code with code tags:
YOUR CODE HERE
to get highlighting and preserve...
Then you need to put something into the array BEFORE trying to access it. Assign some values to the s array before trying to access its elements:
s=new String[]{"aa", "bb"}; // define an array...
Can you see the question I have posted? Please answer it.
Once more:
Why is the code trying to access the elements in the s array? Where you given instructions with the assignment about how to execute the program so there would be elements in the s array?
The s array is empty. The code tries to access its first and second elements. The JVM throws an exception: ArrayIndexOutOfBoundsException because there are no elements in the array.
I've asked...
Test the length of the array and don't try to access its elements if there are not enough elements in the array.
Why is the code trying to access the elements in the s array? Where you given...
Can you explain what your problem is? Copy the full text of the error message and paste it here.
Please edit your post and wrap your code with code tags:
YOUR CODE HERE
to get...