help pls with the solution
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 br = new BufferedReader(new InputStreamReader(System.in));
String s; Integer x;
while (true) {
s = br.readLine();
if(s.equals("exit")) break;
else if(ints(s) == s.length()) {
try {
Integer num = Integer.parseInt(strNumber); // if this doesn't throw an exception, it's good.
if (num <= 0 || num >= 128)
return true;
else
return false;
}
catch (Exception e){
return false;
}
}
else if(ints(s) == 1) {
Double d = Double.parseDouble(s);
print(d);
}
else print(s);
}
}
public static int ints(String s) {
int j = 0, k = 0, l = 0;
for(int i = 0; i < s.length(); i++) {
boolean a = s.charAt(i) > 47 && s.charAt(i) < 58;
if(a) {
l++;
}
else if(s.charAt(0) != 46 && s.charAt(i) == 46 || a) k++;
}
if(l == s.length()) j = l;
else if(l == s.length()-1 && k == 1) j = k;
return j;
}
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);
}
}