Не пускает по 3 и 6 пункту. Тест кейсы проходит корректно, наверное :). Плиз, хелп!
package com.javarush.task.task15.task1519;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
/*
Разные методы для разных типов
*/
public class Solution {
public static void main(String[] args) throws IOException {
Solution sol = new Solution();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine(), sub = ".";
while (!s.equals("exit")) {
if (s.contains(sub)) {
try{
Double dub = Double.parseDouble(s);
print(dub);
s = reader.readLine();
continue;
}catch (NumberFormatException e) {
print(s);
s = reader.readLine();
}
}
try {
int checkValue = Integer.parseInt(s);
if (checkValue > 0 && 128 > checkValue) {
short shortValue = Short.parseShort(s);
print(shortValue);
s = reader.readLine();
}else if (checkValue < Integer.MAX_VALUE && checkValue > Integer.MIN_VALUE){
print(checkValue);
s = reader.readLine();
}
}catch (NumberFormatException e) {
print(s);
s = reader.readLine();
}
}
//System.out.println(doubleLacmus);
}
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);
}
}