► |  | How to Design Classes Languages

1 | Professor J Beginner
2 | Professor J Intermediate
3 | Professor J Intermediate + Access
4 | Professor J Advanced
| Index

▼ | 3 | Professor J Intermediate + Access

3.1 | import
3.2 | class
3.3 | interface
3.4 | Modifiers
3.5 | Field
3.6 | Method
3.7 | Constructor
3.8 | Statement
3.9 | Expression

Version: 4.1.4
top← prev up next →

#### 3.6`` Method

MethodReturn Id (Type Id ,...) {Statement ...}

Creates a method, bound to Id, that can be called on the current object, or instances of this class. The body of the method, the statements, will be evaluated sequentially when the method is called. The method name may not be the name of any classes defined in the same program or of any fields or methods in the same class. A method that does not return a value uses the void designation instead of a Type for MethodReturn.

abstract MethodReturn Id (Type Id ,...) ;

Creates a method, bount to Id, inside an abstract class. Like an interface signature, non-abstract classes that inherit this method must provide an implementation.

top← prev up next →