User-Defined Methods

Learn how to make your own methods.

We know that built-in methods are like standard ready-to-cook recipes everyone knows how to use. We also know how to use these built-in methods inside our main method. But did you know we can create our own customized methods as well? After all, we can’t possibly have a ready-made method for every need in the world. Imagine if we wanted to create YouTube, and there was a built-in method buildYouTubeForMe("please")? It doesn’t work like that, right? Instead, Java lets us create methods of our own that we can then use as and when required, just like we can use built-in methods.