Example 1

The Java™ Integer class contains a static method called toString, which accepts an int parameter, and returns a String object. It is declared in Java as follows:
static String  Integer.toString(int)
This method would be prototyped as follows:
D tostring        PR              O   EXTPROC(*JAVA:                 
D                                      'java.lang.Integer':          
D                                      'toString')                   
D                                     CLASS(*JAVA:'java.lang.String')
D                                     STATIC                         
D    num                        10I 0 VALUE                          

The EXTPROC keyword identifies the method as a Java method. It also indicates that the method name is 'toString', and that it is found in class 'java.lang.Integer'.

The O in column 40 and the CLASS keyword tell the compiler that the method returns an object, and the class of that object is 'java.lang.String'.

The STATIC keyword indicates that the method is a static method, meaning that an Integer object is not required to call the method.

The data type of the parameter is specified as 10I, which maps to the Java int data type. Because the parameter is an int, it must be passed by value, and the VALUE keyword is required.


Feedback