%% Call Method on Java Object
% Create a java.util.Date object myDate and change the month to April. From the Java documentation, "A month is represented by an integer from 0 to 11; 0 is January, 1 is February, and so forth." Therefore, the numeric value for April is 3.

myDate = java.util.Date;
javaMethod('setMonth',myDate,3)

% Copyright 2012 The MathWorks, Inc.