S
S
Sergey Sergey2021-04-28 23:20:11
Java
Sergey Sergey, 2021-04-28 23:20:11

Can a return statement pass values ​​to another method?

That is, according to this principle, there is a connection between methods.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-04-28
@Sergei1111

It returns the value to the place where the method was called.
Something like this (pseudocode)

void main() {
  var x = getSomething();
  // x == 42
}

int getSomething() {
  return 42;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question