Gordon Beaton wrote:
On Wed, 30 Aug 2006 13:44:41 -0400, HappyHippy wrote:
Can I do something like this for Integer's assignment operator?
Something like:
jmethodID methodId = env->GetMethodID(objClass, "=",
"(Ljava/lang/Integer;)Ljava/lang/Integer;");
Please explain exactly what it is you're trying to achieve, not how
you hope to achieve it.
To see what methods the Integer class has, use javap -s. The only way
to assign a value to an Integer is to specify the value when you
invoke the constructor.
If your class has an Integer field and you want to assign an
(existing) Integer *object* to it, use SetObjectField().
Please don't multipost. I've *crossposted* this reply and set
followups to c.l.j.programmer.
/gordon
I want to achieve the effect of the following assignment (which can be
done in Java)
SomeNumber = 5;
where SomeNumber is of type java.lang.Integer
But in a native method I do not have an Integer object, I have jobject
instead.
So, my question is: is it possible to invoke assignment operator "=" on
the object referenced by jobject?
As far as I know (I don't know much about Java...) assignment operator is
kind of special and it is "hidden" in Java.
perform the assignment.