Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Part 3.1Subprograms in Java

Part 3.1Subprograms in Java

The first thing most developers come across in Java is subprogram or procedures.

A subprogram is a division of code that separates operations from each other. A subprogram allows code to be organised based on it's purpose.

A subprogram could be created to carry out a task that involves something specific on the computer such as deleting a file. If this was what the subprogram does, then the subprogram should have an appropriate name to make it clear that this is what it does.

When the code is required or must be run, it is called. The part of the subprogram that uniquely identifies it is the name combined with the parameters. This is called the signature.

Below is a simple diagram that explains the subprogram structure:

Subprogram

Defining a subprogram

Below is an example subprogram:

Java
void main(String[] argv){
  // Do something
}
Feedback 👍
Comments are sent via email to me.