Methods are declared using the following syntax: : Method « Java Source And Data Type « SCJP

Home
SCJP
1.Java Source And Data Type
2.Operators
3.Modifiers
4.Type Casting
5.Statements
6.Object Oriented
7.Thread
8.Utility Classes
9.File
SCJP » Java Source And Data Type » Method 
1.23.1.Methods are declared using the following syntax:
modifiers returnValue methodName(parameterListthrowsClause {
 // Method body
}

public class MainClass {
  public static void main(String[] argv) {
    System.out.println();
  }
}
1.23.Method
1.23.1.Methods are declared using the following syntax:
1.23.2.A method may have access modifier and the special modifiers.
1.23.3.Summary of Java keywords used with methods.
1.23.4.The return type of a method
1.23.5.The throws clause identifies all of the checked exception types that may be thrown
1.23.6.Declare super exception for method
1.23.7.Invoke a Method
1.23.8.It is illegal for a class to declare two methods with the same signature.
1.23.9.You can return null in a method with an object reference return type.
1.23.10.With a primitive return type, you can return any value or variable that can be implicitly converted to the declared return type.
1.23.11.You can return any value or variable that can be explicitly cast to the declared return type.
1.23.12.You must not return anything from a method with a void return type.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.