|
Re: How to compare variable types in Java
Quote:
Originally Posted by titaniumdecoy
Assuming the increase variable in the code you posted is a Scanner, you can either use the hasNextInt() method to determine if the data waiting to be read can be interpreted as an int value, or catch an exception.
|
You are assuming that the code is of class Scanner.. On the first look i thought of a object reference instead of premetive type.
__________________
[Pushkaraj]
Imagination is more important than knowledge – Albert Einstein
|