View Single Post
Old Feb 14th, 2008, 5:42 AM   #14
pushkarajthorat
Java Developer
 
pushkarajthorat's Avatar
 
Join Date: Jun 2006
Location: Solapur, India.
Posts: 24
Rep Power: 0 pushkarajthorat is an unknown quantity at this point
Send a message via Yahoo to pushkarajthorat
Re: How to compare variable types in Java

Quote:
Originally Posted by titaniumdecoy View Post
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
pushkarajthorat is offline   Reply With Quote