Why it doesnt complete the task?
package com.codegym.task.task15.task1519;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
/*
Different methods for different types
*/
public class Solution {
public static void main(String[] args) throws IOException {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = "";
while(true){
s=reader.readLine();
if(s.equals("exit")){
break;
} else if (s.contains(".")){
Double d = Double.parseDouble(s);
print(d);
} else if(Integer.parseInt(s) > 0 && Integer.parseInt(s) <128){
Short sh = Short.parseShort(s);
print(sh);
} else if(Integer.parseInt(s) <=0 || Integer.parseInt(s) >=128){
Integer ins = Integer.parseInt(s);
print(ins);
}
}
}
public static void print(Double value) {
System.out.println("This is a Double. Value: " + value);
}
public static void print(String value) {
System.out.println("This is a String. Value: " + value);
}
public static void print(short value) {
System.out.println("This is a short. Value: " + value);
}
public static void print(Integer value) {
System.out.println("This is an Integer. Value: " + value);
}
}