Re: Converting an object to integer

2006-07-21 Thread Scott Van Wart
temp temp wrote: The object which I want to convert into Integer is a number and can be converted to int, its not a string or a boolean . I get this object either from request attribute , or request parameter or a DAO. If I get this ob ject from request parameter I cannot cast it to int

Re: Converting an object to integer

2006-07-21 Thread Martin Gainty
ent: Friday, July 21, 2006 3:14 PM Subject: Re: Converting an object to integer > The object which I want to convert into Integer is a number and can be > converted to int, its not a string or a boolean . > I get this object either from request attribute , or request parameter or a

Re: Converting an object to integer

2006-07-21 Thread Michael Jouravlev
On 7/21/06, temp temp <[EMAIL PROTECTED]> wrote: If I get this ob ject from request parameter I cannot cast it to integer because I get compilation error stating that cannot cast a String to integer in this case do I have to create a new Integer every time ? Well, d'oh! --

Re: Converting an object to integer

2006-07-21 Thread temp temp
The object which I want to convert into Integer is a number and can be converted to int, its not a string or a boolean . I get this object either from request attribute , or request parameter or a DAO. If I get this ob ject from request parameter I cannot cast it to integer because I ge

Re: Converting an object to integer

2006-07-21 Thread Scott Van Wart
temp temp wrote: What is the best way to convert an object to an Integer .If casting dosen't work? Object probablyAnInteger = ; Integer someInt; if ( probablyAnInteger == null || probablyAnInteger.equals( "" ) ) { someInt = null; } else { try { someInt = new Integer( probablyAnI

Converting an object to integer

2006-07-21 Thread temp temp
What is the best way to convert an object to an Integer .If casting dosen't work? Thanks & Regards - Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2ยข/min or less.