Summary of Java keywords used with methods. : 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.3.Summary of Java keywords used with methods.
Keyword        Implication

public         The method is visible to all classes in the program.

private        The method is visible only inside the class.

protected      The method is visible to classes inside the package and to subclasses.

final          The method cannot be overridden in subclasses.

abstract       The method is declared without an implementation.

static         The method is independent of any object of the class but can address only static variables.

native         The implementation must be provided in machine language for a specific system.

strictfp       All floating-point math in the method must reduce all intermediate results to the standard 32- or 64-bit form.

synchronized   A Thread entering this method obtains a lock on the object.

throws         It introduces a list of checked exceptions that the method may throw

void           If the method does not return a value, the word "void" must appear as the return type.
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.