JavaCast
Last updated
Was this helpful?
Cast a variable to a specified Java type
JavaCast(type=[string], variable=[any])type
string
true
The name of a Java primitive or a Java class name.
variable
any
true
The variable, Java object, or array to cast.
Converts the number 180.0 degrees to radians using Java method: Math.toRadians(double degrees)
createObject( "java", "java.lang.Math" ).toRadians( javaCast( "double", 180.0 ) );
Result: 3.141592653589793
Last updated
Was this helpful?
Was this helpful?
// Convert a Boxlang Number to a Java double primitive
// Converts the number 180.0 degrees to radians using Java method: Math.toRadians(double degrees)
writeDump( createObject( "java", "java.lang.Math" ).toRadians( javacast( "double", 180.0 ) ) );
