|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Change Data Type?
How do you change the data type? I need to change a int to a boolean.
|
|
#2
|
|||
|
|||
|
You can't directly. Try something like:
Code:
my_bool = !( new Integer( my_int ).equals( new Integer( 0 ) ) ); or, probably faster: Code:
my_bool = my_int > 0 ? true : false; |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Change Data Type? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|