|
SOLUTIONS
|
JLINK SYMBOL
ReturnAsJavaObject
ReturnAsJavaObject[expr]
causes a Java method call or field access during the evaluation of expr to return its result as an object reference (a JavaObject expression), not a value.
DetailsDetails
- To use ReturnAsJavaObject, you first need to load J/Link using Needs["JLink`"].
- Most Java objects are returned as references normally, but those that have a meaningful Mathematica representation are returned "by value". Such objects include strings, arrays, and the so-called wrapper classes like java.lang.Integer. ReturnAsJavaObject overrides the normal behavior and forces any object returned to Mathematica to be sent only as a reference.
- Typically used to avoid needlessly sending large arrays of numbers back and forth between Java and Mathematica.
- You can use ReturnAsJavaObject to cause only a reference to be sent, then use the JavaObjectToExpression function at the end if the final value is needed.
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
