CSC 120 Lecture Notes - Lecture 5: Return Type

49 views2 pages
Verified Note

Document Summary

A class may have as many methods as one wants. The order of the methods does not matter in java. A method is a collection of statements that perform some specific task and return result to the caller. A method can perform some specific task without returning anything. Methods allow us to reuse the code without retyping the code. In java, every method must be part of some class and which. Methods are time savers and help us to reuse the code without retyping the code. https://www. geeksforgeeks. org/methods-in-java/ 1- public- the one csc120 will be using. Return type: the data type of the value that will be returned by the method or void if does not return a value. Method name: a name chosen by the user. Parameter list: you must put your values with their data type in the paranthesis. If there is more than one value, they must be separated by comma.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents