This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
In that case you can make Regex pattern and check if contains only number form [0-9] means int. If contains Alphabet from [A-Za-z0-9] and other special character then String. If input contains [0-9] with (DOT .) then float. you can set it according to your requirement.