toJavaObject
Convert, if possible, any value to a Java object of a given class.
(javaObj)=toJavaObject(object,javaClass)
Inputs
object Any variable or expression.
javaClass A Class object or the full name of a Java Class.
Outputs
javaObj The desired Java object.


Example
>>c=toJavaObject({"A","B","C"},"[Ljava.lang.String;")
>>c
A
B
C
>>c.getClass()
class [Ljava.lang.String;
>>c=toJavaObject({2,3,4},"[Ljava.lang.Integer;")
>>c
2
3
4
>>c.getClass()
class [Ljava.lang.Integer;
>>a=rand(1,2,1,1);
>>a
[:, :, 1, 1]
0.7904     0.2361
>>c=toJavaObject(a,"[D")
>>c
0.7904181691647036
0.236080790314243
>>c.getClass()
class [D