octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48790] javaArray('double',1)


From: Andrew Janke
Subject: [Octave-bug-tracker] [bug #48790] javaArray('double',1)
Date: Sun, 1 Jul 2018 01:11:40 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36

Follow-up Comment #6, bug #48790 (project octave):

Hi folks.

There might be a bit of confusion here about the exact Java types we're
dealing with.

In Java:

* java.lang.Double is not the same as the primitive double type: it is an
object wrapper for it
* java.lang.Double.class is the class of the object wrapper
* java.lang.Double.TYPE is the class of the corresponding primitive type

Matlab does not auto-convert the object wrapper types like java.lang.Double or
java.lang.Double[]; it merely has a convenience display function that makes
them look like primitive types.


>> java.lang.Double(42)
ans =
42.0
>> class(ans)
ans =
    'java.lang.Double'
>> java.lang.Double.class
ans =
    'java.lang.Double'
>> java.lang.Double.TYPE
ans =
double
>> class(ans)
ans =
    'java.lang.Class'


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48790>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]