Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

new

Create a new Java object


Description

Creates a new Java object and invokes the constructor with given arguments.

Details

The new method is used as the high-level API to create new Java objects (for low-level access see .jnew). It returns the newly created Java object.

... arguments are passed to the constructor of the class specified as J("class.name").

Methods

new

signature(Class = "jclassName"): ...

See Also

Examples

## Not run: 
v <- new(J("java.lang.String"), "Hello World!")
v$length()
v$indexOf("World")
names(v)

## End(Not run)

rJava

Low-Level R to Java Interface

v1.0-4
LGPL-2.1
Authors
Simon Urbanek <simon.urbanek@r-project.org>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.