+ 1

Como en que situación se utiliza return?

20th Mar 2018, 12:18 AM
JOEL Timana (jOWEL)
JOEL Timana (jOWEL) - avatar
2 odpowiedzi
+ 2
thanks!!
20th Mar 2018, 1:03 AM
JOEL Timana (jOWEL)
JOEL Timana (jOWEL) - avatar
+ 1
Returning values from a method is the most common way to pass information to the calling method. The other way is to have shared data and, depending on it's scope, is frowned upon. Designing using OOP ( object-oriented programming) means that data's scope must be limited to as little code as makes sense. When you make globals that are modified everywhere, you make code that is difficult to test.
20th Mar 2018, 1:01 AM
John Wells
John Wells - avatar