About 10,300,000 results
Open links in new tab
  1. How to store an array returned by a method in Java

    Feb 24, 2017 · public int[] method() { int z[] = {1,2,3,5}; return z; } The above method does not return an array par se, instead it returns a reference to the array. In the calling function you …

  2. How to Return an Array in Java? - GeeksforGeeks

    Jun 29, 2022 · The java.lang.reflect.Array.getShort() is an in-built method of Array class in Java and is used to return the element present at a given index from the specified Array as a short. …

  3. How to return an Array in Java [Practical Examples] - GoLinuxCloud

    Feb 22, 2022 · There are three different ways to return an array from a function in Java as listed below: Return an array of primitive type, Return an array of objects, Return a multidimensional …

  4. How To Pass / Return An Array In Java - Software Testing Help

    Apr 1, 2025 · This tutorial will explain how to pass an array as an argument to a method and as a return value for the method in Java with simple examples.

  5. How to Return an Array in Java? (from a Method) | FavTutor

    Sep 26, 2024 · Returning arrays from a function are pretty simple. A method that returns an array needs to have the return type of the function set to the appropriate data type for the array. …

  6. How to return an array in Java? - Tpoint Tech

    In Java, there are several ways to return an array from a method, each offering its own advantages and use cases. These methods can be broadly categorized into static arrays, …

  7. How to Return Array in Java - Delft Stack

    Feb 2, 2024 · To return an array from a class, we need a class ArrayReturningClass and a function inside it createNewArray, that returns an array, the return type in our case is int. In …

  8. How to Return Array in Java - Scientech Easy

    Feb 14, 2025 · Learn how to return an array in java with example, syntax for returning one dimensional array from a method, 2D array from a method in java

  9. Returning Arrays from Method in Java - Tutor Joes

    This program demonstrates how to define and call a function in Java that returns an array, and how to sort an array using the Arrays.sort () method.

  10. Java Method Call Array - Stack Overflow

    Oct 17, 2014 · How do I pass an array from my main method to another method? I'm having an error with the parameters. Do I use the return value from main? And since the return value …

Refresh