Skip to main content

Functions

Learn Functions (Programming Concepts, Programming Fundamentals) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

What is a Function? A function (called a "method" in Java when it belongs to a class) is a named, reusable block of code that performs a specific task. Instead of copy-pasting the same logic everywhere it's needed, you define it once and "call" it by name wherever it's needed.

More lessons in Programming Concepts