|
Do you need help with your Java programming?
Click here for instant help with your Java code. |
Chapter 6: Methods in Java
A method in Java is a sequence of commands that are invoked in a predefined order. A method declaration, or the method signature, is the API for the method and contains all essential information that needs to be known in order to call it. A method signature can be divided into several parts: - The name of the method - The input parameters of the method. - The return type of the method. - Possible exceptions that are thrown from the method. - Method modifiers. The format looks like this: |
modifiers type name ( parameter-list ) [ throws exceptions ] |
These different parts of the method signature will be explained in the coming sections. |
| Previous | Next | |
Tutorial Home | ||
| Do you know your Java? | |
| Take a Ten-Question-Java-Quiz! | |
Search for code examples on this site
