Fiveable
Fiveable

Return Type

Definition

The return type in programming refers to the data type of the value that a method or function will return when it is called. It specifies what kind of data will be returned by the method.

Analogy

Think of a vending machine. When you insert money and press a button, you expect to receive something in return. The return type is like the label on the vending machine that tells you what kind of item you can expect to get back.

Related terms

Method Name: The name given to a method or function which helps identify and call it within a program.

Parameters: Inputs or arguments passed into a method or function for it to perform its task.

Data Type: Specifies the type of data that can be stored in a variable, such as integer, string, boolean, etc.

collegeable - rocket pep

Are you a college student?

  • Study guides for the entire semester

  • 200k practice questions

  • Glossary of 50k key terms - memorize important vocab



© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.