Professional Documents
Culture Documents
Chapter 4 Oop
Chapter 4 Oop
CHAPTER 4:
Methods- Introduction to Methods
Method header
Method definition
Invoke Method
int result;
if(num1>num2) Method
result = num1; Body
else
result=num2;
return result; Return
statement
}
Prepared by: Mrs Sivabalan 6
Invoke Method
Create an object
Primitive Type
Return either double, int, char, String
At the end MUST have return statement
Void
Return nothing
Cannot have return