Procedures are a variant of subprograms.
Subprograms are a part of a computerprogram which provides a special function. Other programs can call a subprogram and give them a task. After the subprogram finished its part, it gives the maintask back to the origin program.

You can call an instruction and use it once or multiple times with its name (here: punkteZeichnen).

Example for a procedure in Java:

public class Example
{
public static void punkteZeichnen (int quantity) {
for (int i = 0; i < quantity; i++) {
System.out.print (".");
}
}
}

  • realize a procedure in Java ( methodes without return value)

Example for calling a methodein Java:


Example.punkteZeichnen(5);

Procedures
Tagged on:

Leave a Reply

Your email address will not be published. Required fields are marked *