Next: How can I handle memory limitations?, Previous: How to make Java classes available?, Up: FAQ - Frequently asked Questions
If your code shall work under Octave as well as matlab you should use the
function javaObject
to create Java objects. The function
java_new
is Octave specific and does not exist in the matlab
environment.
Example 1, suitable for Octave but not for matlab:
Passenger = java_new('package.FirstClass', row, seat);
Example 2, which works in Octave as well as in matlab:
Passenger = javaObject('package.FirstClass', row, seat);