Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java int to double

// Primitive type
int myInt = 5;
double myDouble = (double)myInt;		// explicit cast
myDouble = myInt;						// implicit cast
// Object type
Double myDouble = new Double(myInt)		// via constructor
myDouble = Double.valueOf(myInt)		// via valueOf
 
PREVIOUS NEXT
Tagged: #java #int #double
ADD COMMENT
Topic
Name
2+4 =