Thursday, January 7, 2010

Conversion of Integer to int, Double to double in Java(Data Type Conversion)

  Hi, This code will be very useful and help you in saving time while searching the code for the Datatype Conversion




Conversion of the Double to double 
 annualDemand = new Double(annualDemand.doubleValue()*2.0);
In the Above example,  annualDemand  is a Double datatype
Converting the annualDemand to double and performing a multiplication with 2.0 and converting back to Double.