Can anyone tell me why this not verify ?
package com.codegym.task.task15.task1527;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Solution {
public static void main(String[] args) throws IOException {
List<String> list = new ArrayList<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
list.add(s.substring(s.indexOf("?") + 1, s.indexOf("=")));
list.add(s.substring(s.indexOf("=") + 1, s.indexOf("&")));
String[] listForSplit = s.split("&", 0);
for (int i = 1; i < listForSplit.length - 1; i++) { list.add(listForSplit[i]); }
list.add(listForSplit[listForSplit.length - 1].substring(0, listForSplit[listForSplit.length - 1].indexOf("=")));
String var = list.get(1);
list.remove(1);
for (String x : list) { System.out.print(x + " "); }
System.out.println();
for (int i = 0; i < var.length(); i++) {
if (var.charAt(i) == '.') {
double d;
try {
d = Double.parseDouble(var);
alert(d);
} catch (NumberFormatException e) {
alert(var);
}
}
}
}
public static void alert(double value) {
System.out.println("double: " + value);
}
public static void alert(String value) {
System.out.println("String: " + value);
}
}