4️⃣

11.4 Method Signatures

The method signature (also called method header) is the first line of your method declaration which contains information like its modifiers, return type, method name, and parameters. You will learn more about modifiers, return types, and parameters later in this chapter.

Here’s the method signature for the main method:

public static void main(String[] args)

This is the general format for a method signature:

<modifier(s)> <return type> methodName(<parameter(s)>)

image

Image Credit: GeeksForGeeks

Previous Section

Next Section

⚖️

Copyright © 2021 Code 4 Tomorrow. All rights reserved. The code in this course is licensed under the MIT License. If you would like to use content from any of our courses, you must obtain our explicit written permission and provide credit. Please contact classes@code4tomorrow.org for inquiries.