In computer programming, the return type (or result type) defines and constrains the data type of the value returned from a subroutine or method. In many programming languages (especially statically-typed programming languages such as C, C++, Java) the return type must be explicitly specified when declaring a function.
In the Java example:
public int someMethodthe 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 does not return any value, e.g., a return type of void is used in some programming languages:
public void returnNothingFamous quotes containing the words return and/or type:
“I am apt to think, if we knew what it was to be an angel for one hour, we should return to this world, though it were to sit on the brightest throne in it, with vastly more loathing and reluctance than we would now descend into a loathsome dungeon or sepulchre.”
—George Berkeley (16851753)
“He turned out to belong to the type of publisher who dreams of becoming a male muse to his author, and our brief conjunction ended abruptly upon his suggesting I replace chess by music and make Luzhin a demented violinist.”
—Vladimir Nabokov (18991977)