Is there any in-built method in Java where you can find the user input\'s type whether it is positive, or negative and so on? The code below doesn\'t work. I am trying to fi
You could use if(number >= 0). The fact that you use int number = input.nextInt(); makes sure that it has to be an Integer.
if(number >= 0)
int number = input.nextInt();