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.

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.

"Return Type" appears in:

Study guides (2)

  • AP Computer Science A - 5.4 Accessor Methods

  • AP Computer Science A - 5.6 Writing Methods

Practice Questions (9)

  • Which of the following is true regarding the return type of an overriding method in a subclass?

  • When a subclass defines a method with the same name, return type, and parameters as a method in its superclass, it is an example of:

  • What happens if a method is declared with a return type but does not contain a return statement?

  • Can a constructor have a return type in Java?

  • What should the return type of a getter method that retrieves a variable storing the number of siblings a person has be?

  • The return type of a getter method is...

  • What should the return type of a getter method that gives us the value of a variable storing the school a person attends be?

  • What should the return type of a getter method that returns the value of a variable storing whether or not a person is above 5 foot 2 be?

  • What is the purpose of a return type in a method header?

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


Fiveable
About Us

About Fiveable

Blog

Careers

Code of Conduct

Terms of Use

Privacy Policy

CCPA Privacy Policy

Resources

Cram Mode

AP Score Calculators

Study Guides

Practice Quizzes

Glossary

Cram Events

Merch Shop

Crisis Text Line

Help Center

Stay Connected


© 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.

About Us

About Fiveable

Blog

Careers

Code of Conduct

Terms of Use

Privacy Policy

CCPA Privacy Policy

Resources

Cram Mode

AP Score Calculators

Study Guides

Practice Quizzes

Glossary

Cram Events

Merch Shop

Crisis Text Line

Help Center

© 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.