Share on Facebook Share on Twitter Email
Answers.com

Return type

 
Wikipedia: Return type

In computer programming, the return type defines and constrains the type of value returned from a method or function. In many programming languages (especially those that are statically-typed, such as Java, C++, C) the return type must be explicitly specified when declaring a function.

In the Java example:

public int someMethod()

the return type is int. The program can therefore rely on the method returning a value of type int. Various mechanisms are used for the case where a subroutine that does not return any value, e.g., a return type of void in some programming languages:

public void returnNothing()

See also


Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics
 
 

 

Copyrights:

Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "Return type" Read more

 

Mentioned in