Some advice would be appreciated
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 {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while (true) {
String input = reader.readLine();
int intInput;
if (input.equals("exit")) break;
try {
intInput = Integer.parseInt(input);
if (intInput > 0 && intInput < 128) print((short) intInput);
else if (intInput <= 0 || intInput >= 128) print(intInput);
continue;
} catch (NumberFormatException e) {
}
if (input.contains(".")) {
print(Double.valueOf(input));
} else print(input);
}
}
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);
}
}