Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.0 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Java from Scilab > jgetfield


Get the field value of a Java object

Calling Sequence

jgetfield(object, fieldName [, unwrap])



A mlist typed _JObj or _JClass or a Scilab variable


A string giving the field name


A single boolean


Get the value of the field named fieldName. If the optional third argument is true, then the value is automatically unwrapped.

This function also works with beans properties which may not be mapped to a public java field.


c = jcompile("Test", ["public class Test {";
                      "public int field;";
                      "public Test(int n) {";
                      "field = n;";
t =;
v = jgetfield(t, "field")

// or easier

jremove c t v;
jimport java.util.Date;

d =;
d.minutes, // will call d.getMinutes()
jgetfield(d, "minutes"), // will also call d.getMinutes()

jremove Date d;

See Also


5.5.0 Function introduced. Based on the 'JIMS' module. The main difference in the behavior compared to the JIMS module is that jautoUnwrap is enabled by default.
Report an issue
<< jgetclassname Java from Scilab jgetfields >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Fri Apr 11 14:07:05 CEST 2014