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:
“Compassion is frequently a sense of our own misfortunes, in those of other men; it is an ingenious foresight of the disasters that may fall upon us hereafter. We relieve others, that they may return the like when our occasions call for it; and the good offices we do them are, in strict speaking, so many kindnesses done to ourselves beforehand.”
—François, Duc De La Rochefoucauld (16131680)
“Are God and Nature then at strife,
That Nature lends such evil dreams?
So careful of the type she seems,
So careless of the single life;”
—Alfred Tennyson (18091892)