What is the reason that currently programming languages simply allow one method to return a value?
I would like to know several reasons why, for example, Java does not allow the use of the method
public String, Car, Driver exampleMethodName(String name, Car car, Driver driver);
and assign return values, for example. eg:
String name;
Car ford;
Driver john;
name, ford, john = exampleMethodName(String name, Car car, Driver driver)
Using the same concept and syntax as parameters during method invocation.
This is not possible in most languages, but why? There are ways to solve this problem, such as using arrays, lists, or custom objects.
What concept is opposed to having different (different types) of multiple return values?
source
share