About 30,900,000 results
Open links in new tab
  1. Java return Keyword - W3Schools

    The return keyword finishes the execution of a method, and can be used to return a value from a method.

  2. Java return Keyword - GeeksforGeeks

    Jan 2, 2025 · return keyword in Java is a reserved keyword which is used to exit from a method, with or without a value. The usage of the return keyword can be categorized into two cases: …

  3. How to use return value from method in Java? - Stack Overflow

    Mar 11, 2015 · I want to use the return value from a member function by storing it into a variable and then using it. For example: public int give_value (int x,int y) { int a=0,b=0,c; c=a+b; return …

  4. How do I return a value from a Java function? - Stack Overflow

    Dec 28, 2016 · In order to make use of a return a value from a function you must assign it to a variable or use it as a test condition, etc. if(returnTen(mystery, subend, result, success) > 0){ …

  5. Returning a Value from a Method (The Java™ Tutorials - Oracle

    Within the body of the method, you use the return statement to return the value. Any method declared void doesn't return a value. It does not need to contain a return statement, but it may …

  6. How to return 2 values from a Java method? - Stack Overflow

    May 14, 2010 · You can use SimpleEntry<type_of_value_1, type_of_value_2> from java.util.AbstractMap.SimpleEntry and use it with getKey() to get object 1 and getValue() to get …

  7. return Keyword in Java: Usage & Examples - DataCamp

    Learn how to use the `return` keyword in Java to exit methods and return values. This guide covers syntax, examples, and best practices for effective Java programming.

  8. Return Statement in Java - Tpoint Tech

    Feb 12, 2025 · In Java programming, the return statement is used for returning a value when the execution of the block is completed. The return statement inside a loop will cause the loop to …

  9. Java return Statement - Java Guides

    The return statement in Java is a control flow statement used to exit a method and optionally return a value to the caller. It plays a critical role in methods by indicating the end of the …

  10. Returning Values From Methods (Java) – GeekTechStuff

    Jun 9, 2019 · Java Return Method The above example will return the integer 4 to the main method. The below methods so various examples of the returns including how values can be …

  11. Some results have been removed
Refresh