Java Columns - 3
Initialize via NEW and constructor call
INSERT INTO java_hello_world
( pkey, JHelloWorld )
VALUES
( 1, NEW HelloWorld() );
Polymorphism allows multiple constructors
INSERT INTO java_hello_world
( pkey, JHelloWorld )
VALUES
( 2, NEW HelloWorld ( 'Hello', 'World', 0 ) );
Notes:
Constructors are methods with the same name as the class they are part of. More than one constructor can coexist as long as they have different numbers and types of parameters. In this example a default constructor (no parameters) is called as well as one which lets the caller specify values for each field in the class.