Page #500 (Appendix C. Operator Precedence Chart)

 
[Page 1276]

Appendix D. Java Modifiers

Modifiers are used on classes and class members (constructors, methods , data, and class-level blocks), but the final modifier can also be used on local variables in a method. A modifier that can be applied to a class is called a class modifier . A modifier that can be applied to a method is called a method modifier . A modifier that can be applied to a data field is called a data modifier . A modifier that can be applied to a class-level block is called a block modifier . The following table gives a summary of the Java modifiers.


[Page 1277]
Modifier class constructor method data block Explanation
(default) [*] check mark check mark check mark check mark check mark A class, constructor, method, or data field is visible in this package.
public check mark check mark check mark check mark   A class, constructor, method, or data field is visible to all the programs in any package.
private   check mark check mark check mark   A constructor, method or data field is only visible in this class.
protected   check mark check mark check mark   A constructor, method or data field is visible in this package and in subclasses of this class in any package.
static     check mark check mark check mark Define a class method, or a class data field or a static initialization block.
final check mark   check mark check mark   A final class cannot be extended. A final method cannot be modified in a subclass. A final data field is a constant.
abstract check mark   check mark     An abstract class must be extended. An abstract method must be implemented in a concrete subclass.
native     check mark     A native method indicates that the method is implemented using a language other than Java.
synchronized     check mark   check mark Only one thread at a time can execute this method.
strictfp check mark check mark       Use strict floating-point calculations to guarantee that the evaluation result is the same on all JVMs.
transient         check mark Mark a nonserializable instance data field.

[*] Default access has no modifier associated with it. For example: class Test {}

 


Introduction to Java Programming-Comprehensive Version
Introduction to Java Programming-Comprehensive Version (6th Edition)
ISBN: B000ONFLUM
EAN: N/A
Year: 2004
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net