Well, I don't understand in which case I'm wrong, even when I test with a custom link...
package com.codegym.task.task15.task1527;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.*;
/*
Request parser
*/
public class Solution {
public static void main(String[] args) {
//write your code here
String url = new Scanner(System.in).nextLine(), parameters = "";
Double valeur = null;
ArrayList<Character> listChar = new ArrayList<>();
for (Character c : url.toCharArray()
) {
listChar.add(c);
}
Iterator<Character> iterator = listChar.iterator();
while (iterator.hasNext()) {
Character c = iterator.next();
if (c.equals('?')) {
if (!url.contains("obj")) {
while (iterator.hasNext()) {
Character d = iterator.next();
//System.out.print(d);
if (d.equals('&')) parameters += " ";
else if (Character.isDigit(d) || d.equals('=')) ;
else if (Character.isUpperCase(d)) break;
else parameters += d;
}
} else {
while (iterator.hasNext()) {
Character d = iterator.next();
String doubleString = "";
while (iterator.hasNext() && valeur == null && !d.equals('&') ) {
if (!(Character.isAlphabetic(d)) && !d.equals('=')) {
doubleString += d;
}
d= iterator.next();
}
if (!doubleString.isEmpty()) {
valeur = Double.valueOf(doubleString);
}
//System.out.print(d);
if (!parameters.contains("obj"))parameters+="obj";
if (d.equals('&')) parameters += " ";
else if ( d.equals('=')) ;
else if (Character.isUpperCase(d)) break;
else parameters += d;
}
}
}
}
alert(parameters);
if (valeur != null) alert(valeur);
}
public static void alert(double value) {
System.out.println("double: " + value);
}
public static void alert(String value) {
System.out.println("String: " + value);
}
}