Ребята, что не так? В Idea все пашет, а валидатор не принимает.
package com.javarush.task.task15.task1519;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Разные методы для разных типов
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String wrds = null;
Boolean t;
while (true) {
wrds = reader.readLine();
try {
Double.parseDouble(wrds);
t = true;
} catch (NumberFormatException ex) {
t = false;
}
if (wrds.equals("exit")) {
break;
}
else if (t == true) {
if (wrds.contains(".")) {
print(Double.parseDouble(wrds));
} else if (Short.parseShort(wrds) < 128 & Short.parseShort(wrds) > 0) {
print(Short.parseShort(wrds));
} else if (Integer.parseInt(wrds) <= 0 || Integer.parseInt(wrds) > 128) {
print(Integer.parseInt(wrds));
}
}
else
print(wrds);
}
}
public static void print(Double value) {
System.out.println("Это тип Double, значение " + value);
}
public static void print(String value) {
System.out.println("Это тип String, значение " + value);
}
public static void print(short value) {
System.out.println("Это тип short, значение " + value);
}
public static void print(Integer value) {
System.out.println("Это тип Integer, значение " + value);
}
}