Добрый день. Почему не проходит проверку 3 условие?
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 {
//напиште тут ваш код
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int n;
Short i;
Double d;
Integer num;
while (true) {
String s = reader.readLine();
n = s.indexOf(".");
try {
if (s.equals("exit")) {break;}
else if (n == 1) {
d = Double.parseDouble(s);
print(d);}
}
catch (Exception e) {}
try {
if ((i = Short.parseShort(s)) > 0 && (i = Short.parseShort(s)) < 128 && n != 1) {
print(i);}
}
catch (Exception e) {}
try {
if (((num = Integer.parseInt(s)) <= 0 || (num = Integer.parseInt(s)) >= 128) && (n != 1)) {
print(num);}
}
catch (Exception e) {}
try{d = Double.parseDouble(s);}
catch (Exception e) {print(s);}
}
}
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);
}
}