User-Defined Methods
User-defined methods are custom blocks of code we create to perform specific tasks, making programs more organised and reusable.
Core concept
A method has a name, optional parameters (inputs), and a return type (the type of value it gives back, or void if nothing is returned).
How it works
Methods help break down complex programs into smaller, manageable pieces, each responsible for a specific task.
Why it matters
Calling a method executes its code, and if it returns a value, that value can be used in the calling code.
Key detail
Understanding user-defined methods helps us write organised, reusable, and easier-to-maintain Java programs.
Exam highlight
Key diagram

Keywords worth remembering
Trending
Most searched
Quick revision
Study resources
Notes & downloads
Quick notes
• A method has a name, parameters, return type.
• Void means no value is returned.
• Methods break programs into manageable pieces.
• Each method handles a specific task.
• Calling a method executes its code.
• Returned values can be used in calling code.
• Methods promote organisation and reusability.
• This makes programs easier to maintain.