Check if values has 4 or more elements. If it does, get the first 4 elements for your data.
Type: Posts; User: Norm
Check if values has 4 or more elements. If it does, get the first 4 elements for your data.
Can you post what you want printed? If the values array has 4 or more elements do you want to see the first 4 elements? To see the contents of the values array use the Arrays class's toString...
What prints out when you print out the value of the variable: data?
Can you copy and paste here what is printed?
What is printed out when you print out the value of the variable: data?
Is is what you expect to see?
String [] values =
...
System.out.println(values [1] + "***");
values is an array.
How do know that the values array has two elements? 1 is the index for second element
Where is the print...
Where in the posted code is an array indexed?
Can you copy and paste here the full text of the error message? You can't copy and paste from an image.
The code should make sure the index does...
Can you post the console from when you execute the code that shows what it is doing?
Add a println() to print out the value of data before it is split.