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

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

  2. Returning a Value from a Method (The Java™ Tutorials ...

    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 …

  3. 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:

  4. 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.

  5. Java Methods (With Examples) - Programiz

    A method is a block of code that performs a specific task. In this tutorial, we will learn to create and use methods in Java with the help of examples.

  6. 5.3. Method Returns — CS Java - runestone.academy

    When a method returns a value, the code should do something with the value such as store it in a variable or print it. You will learn how to create methods that access object attributes in a later …

  7. Mastering Return Statements in Java Methods - javaspring.net

    Jun 11, 2025 · Understanding how to use return statements effectively is essential for writing clean, modular, and efficient Java code. This blog will explore the fundamental concepts, …