Object Oriented Programming - ASSIGNMENT (2)
Object Oriented Programming - ASSIGNMENT (2)
a. Predefined Methods
b. User-defined Methods
• Method declaration
• Method Call
• Void methods
a. Pass-by-reference parameter
b. Use of arrays as parameter of returned values
c. User-defined methods
a. Predefined methods are the ones that the Java class libraries already define.
This means that they can be called and used anywhere in our program without
defining them. There are numerous predefined methods, such as length(),
sqrt(), max(), and print(), and each of them is no defined inside their respective
classes.
• In this program we use the predefined method. For example, if you’re using
java, you can use Math.sqrt() is a method from math class in java. It’s designed
to calculate the square root of a number.
Reference:
• GeeksforGeeks : https://www.geeksforgeeks.org/methods-in-java/
• W3Schools : https://www.w3schools.com/java/java_methods.asp
• Simplilearn.com : https://www.simplilearn.com/tutorials/java-tutorial/methods-in-
java