AKA Method Calls.

AKA Method Calls.



Answer: An invocation of a method that returns a value can be used as an expression anyplace that a value of the typeReturned can be used:typeReturned tRVariable; or tRVariable = objectName.methodName();

A return statement

A return statement



Answer: specifies the value returned and ends the method invocation:return Expression;

An object of a class is named or declared by a variable of the class type: ClassName objectIdentifier;The new operator must then be used to create the object and associate it with its variable name: objectIdentifier = new ClassName();These can be combined as follows:

An object of a class is named or declared by a variable of the class type: ClassName objectIdentifier;The new operator must then be used to create the object and associate it with its variable name: objectIdentifier = new ClassName();These can be combined as follows:



Answer: ClassName objectIdentifier = new ClassName(); Example: Person myPerson = new Person();