Next: Class: Methods Implementation (contd.)
Up: Java Notes
Previous: Classes: Constructors 1: Example
- Declaration: access, return type, name, args
- Return type: primitive or reference (class or interface, must be implemented)
- Args: passed by value, cannot change (reference type: reference not changed but object referenced to may change)
-
abstract
: member of abstract class (no implementation, owner class must be declared abstract)
-
static
: class method (not instance method)
-
final
: cannot be overridden by subclasses
-
native
: implemented in other languages
-
synchronized
: concurrency control in threads
-
throws
exception clause: checked exceptions when error
- Overloading: More than one method with same name and type in a class, distinguished by parameter types and numbers
Ananda Amatya
9/15/1999