Name
jsetfield — Set the field of a Java object
Calling Sequence
jsetfield(object, fieldName, value)
Parameters
- object
A mlist typed _JObj or _JClass or a Scilab variable
- fieldName
A string giving the field name
- value
A Scilab variable or mlist typed _JObj as new field value
Description
Set the field named fieldName to the given value.
Examples
c = jcompile("Test", ["public class Test {";
"public int field;";
"public Test(int n) {";
"field = n;";
"}";
"}";]);
t = c.new(128);
junwrap(t.field)
jsetfield(t, "field", 256);
junwrap(t.field)
// But it is easier to use...
t.field = 512;
junwrap(t.field)
jremove c t;