← Home



According to Google, Decomposition is 'the ability to break down a task into minute details so that we can clearly explain a process to another person or to a computer, or even to just write notes for ourselves'. Computational thinking is the art of abstract problem solving. Decomposition is the first step. In programming we decompose by using methods.

What is a method?

Put simply, a method - also known as a function or procedure in other languages - is a block of code that carries out a task. You can think of them as helpers which all come together in order to help you build your program.

Methods are generally created in order to carry out some specified task, to check if some condition is true or not, or to accept user input. The main point is, they are usually used to segment a program into more understandable steps which can be called in a desired order.


Hitherto all you've met is the main method. This is the method Java calls internally when your program is first run. However you can make others, which is what you will find out how to do next.

How to create a method →