Creates an instance of a Java object.
Valid in: | DATA step |
Applies to: | Java object |
specifies the object reference name for the Java object.
specifies the name of the Java class to be instantiated.
Requirement | The Java class name must be enclosed in either single or double quotation marks. |
specifies the information that is used to create an instance of the Java object. Valid values for argument depend on the Java object.
declare javaobj j; j = _new_ javaobj("somejavaclass" );
testjavaclass
,
is the constructor, and the values 100
and .8
are
constructor arguments.
declare javaobj j; j = _new_ javaobj("testjavaclass", 100, .8);
mhash
,
is necessary because the DATA step's only numeric type is equivalent
to the Java type DOUBLE.
/* Java code */ import java.util.*; public class mhash extends Hashtable; { mhash (double size, double load) { super ((int)size, (float)load); } }
/* DATA step code */
data _null_;
declare javaobj h;
h = _new_ javaobj("mhash", 100, .8);
run;