The type function loads the specified Java class and provides it as an object. Fields of this object can be read directly from it, and new instances can be created with the JavaScript new keyword.
type
new
var BigDec = Java.type('java.math.BigDecimal');var bd = new BigDec("0.1");console.log(bd.add(bd).toString());``` Copy
var BigDec = Java.type('java.math.BigDecimal');var bd = new BigDec("0.1");console.log(bd.add(bd).toString());```
Generated using TypeDoc
The
type
function loads the specified Java class and provides it as an object. Fields of this object can be read directly from it, and new instances can be created with the JavaScriptnew
keyword.