Всем спасибо. Вот рабочий вариант:
public class Solution {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {
            String url = reader.readLine();

            char c = (char) url.indexOf("?");
            String s = url.substring(c + 1);
            String[] str  = s.split("&");

            for (int i = 0; i < str.length; i++){
                System.out.print(str[i].split("=", 2)[0] + " ");
            }
            System.out.println();

            for (int i = 0; i < str.length; i++){
                if(str[i].contains("obj") && (str[i].split("=", 2)[0]).equals("obj")){
                    char c1 = (char) str[i].indexOf("=");
                    String o = str[i].substring(c1+1);
                    try {
                        if ((o.contains(".") && !o.substring(0, 1).equals(".")) && (o.contains(".") && !(o.substring(o.length() - 1).equals(".")))) {
                            alert(Double.parseDouble(o));
                        } else {
                            if ((o.contains(".") && o.substring(0, 1).equals(".")) || (o.contains(".") && o.substring(o.length() - 1).equals("."))){
                                alert(o);
                            }
                            else {
                                if (!o.contains(".")) {
                                    try {
                                        alert(Integer.parseInt(o));
                                    } catch (Exception e) {
                                        alert(o);
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception e) {
                        alert(o);
                    }
                }
            }
        }
        catch (Exception e){
            e.getStackTrace();
        }
    }

    public static void alert(double value) {
        System.out.println("double: " + value);
    }

    public static void alert(String value) {
        System.out.println("String: " + value);
    }
}