tangentum technologies    
 

Deutsch

   
   
 
    Defining methods

3.2. Defining methods

Methods are members of classes and interfaces that contain the instructions which get executed by the Java Virtual Machine. They therefore define the behaviour of the program.

Each method must at least have a name and a signature:

  <method name="method-name">
    <signature>

      <!-- contents of signature definition here -->

    </signature>
  </method>
As an example take the method
  void main(String[] args)
as declared in class HelloWorld:
  <method name="main">
    <signature>
      <param package="java.lang" type="String" array="1"/>
    </signature>
  </method>
The signature of a method consists of a list of parameter-types and at most one result-type as child elements.