Visit complete Java roadmap

← Back to Topics List

Functions

A method/function is a way to perform some task. Similarly, in programming like Java, a function method is a block of code written to perform a specific task repeatedly. It provides reusability of code. We write the function once and use it many times. It works on the ‘DRY’ principle i.e., “Do not repeat yourself”.

Steps -

  1. Define function - datatype function_name(parameters){body}
  2. Call function - function_name(values)

Visit the following resources to learn more:

Resources Community KGx AICbe YouTube

by Devansh Shukla

"AI Tamil Nadu formely known as AI Coimbatore is a close-Knit community initiative by Navaneeth with a goal to offer world-class AI education to anyone in Tamilnadu for free."