Hey guys, I know, I did this task overly complicated :) But I wanted to try to get the variable name and value from every variable displayed in the url. And it´s working! :):):) Therefore I wrote a getVariableValue method, which returns an Object. This object is either a Double or a String. Now I was just modifying the code to satisfy the requirement that only the value of the obj variable should be displayed.
Object obj;
        for (String s : allVariables) {                             //for each of those variables, print out the value
            if (s.contains("obj")) {
                obj = getVariableValue(s);                              //save the value within an object
                if (obj instanceof Double) alert((double) obj);                                //check if object is a Double, then print out the value(object) as a Double
                else if (obj instanceof String && !((String) obj).isEmpty()) alert((String)obj);         //check if object is a String and if it is not empty, then print out the value(object) as a String
            }

        }
public static Object getVariableValue(String s) {
        char currentChar;
        boolean reading = false;                //are we reading the value of the variable already?
        String StringOfValue = "";
        Double value;

        for (int i = 0; i < s.length(); i++) {
            currentChar = s.charAt(i);
            if (currentChar == '=') {           //value starts after =
                reading = true;                 //we start reading....
                continue;                       //but don´t want to include the = in the value
            }
            if (reading) {
                StringOfValue += currentChar;   //construct value from the current chars
            }
        }
        try {
            if (StringOfValue.contains("."))                //if the value contains a "."
                return Double.parseDouble(StringOfValue);   //try to read string as a double, if not possible, catch exeption and read as string
            else return StringOfValue;                      //if the value is an int or String (no double with "."), return a string
        } catch (Exception e) {
            return StringOfValue;
        }
    }
The only requirement not fulfilled is: "The program should call the alert method with the double parameter if the obj parameter can be correctly converted to a double." And I have no idea why. Do you know, what I have to adjust? Thanks a lot in advance!