JLink`
JLink`

MakeJavaObject

MakeJavaObject[expr]

constructs a new Java object whose "value" is expr.

Details and Options

  • To use MakeJavaObject, you first need to load J/Link using Needs["JLink`"].
  • MakeJavaObject is shorthand for calling JavaNew.
  • It is typically used when you need to call a Java method that is typed to take Object, and you want to pass it a numeric, string, or array value. You use MakeJavaObject to manually convert such arguments into Java objects before passing them to the method.
  • expr must be an integer or real number; a String; a Boolean; or a list or matrix of numbers, strings, or Booleans.
  • For an integer expr, the created Java object is of type java.lang.Integer.
  • For a real, the created Java object is of type java.lang.Double.
  • For a String, the created Java object is of type java.lang.String.
  • For a Boolean, the created Java object is of type java.lang.Boolean.
  • For a list or matrix of numbers, strings, or Booleans, the created object is a Java array of the corresponding primitive type. For example, MakeJavaObject[{1,2,3}] would create an int[] with these values.
Wolfram Research (2007), MakeJavaObject, Wolfram Language function, https://reference.wolfram.com/language/JLink/ref/MakeJavaObject.html.

Text

Wolfram Research (2007), MakeJavaObject, Wolfram Language function, https://reference.wolfram.com/language/JLink/ref/MakeJavaObject.html.

CMS

Wolfram Language. 2007. "MakeJavaObject." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/JLink/ref/MakeJavaObject.html.

APA

Wolfram Language. (2007). MakeJavaObject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/JLink/ref/MakeJavaObject.html

BibTeX

@misc{reference.wolfram_2024_makejavaobject, author="Wolfram Research", title="{MakeJavaObject}", year="2007", howpublished="\url{https://reference.wolfram.com/language/JLink/ref/MakeJavaObject.html}", note=[Accessed: 18-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_makejavaobject, organization={Wolfram Research}, title={MakeJavaObject}, year={2007}, url={https://reference.wolfram.com/language/JLink/ref/MakeJavaObject.html}, note=[Accessed: 18-November-2024 ]}