I came across code where i had encountered with Double.valueOf(line.split(",")[1])
I am familiar with Double.valueOf()
and my problem is to understand what does [1]
mean in the sentence. Searched docs didn't find anything.
while ((line = reader.readLine()) != null)
double crtValue = Double.valueOf(line.split(",")[1]);
line#split
returns an array,[1]
acceses the second element of the returned array. – Arielariela