About 13,900,000 results
Open links in new tab
  1. 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. …

  2. java - Returning an array without assign to a variable - Stack Overflow

    Nov 25, 2019 · Is there any way in java to return a new array without assigning it first to a variable? Here is an example: private int a; private int b; private int c; private int d; public int[] …

  3. Returning Arrays in Java - Stack Overflow

    Oct 13, 2012 · Of course the method numbers() returns an array, it's just that you're doing nothing with it. Try this in main(): int[] array = numbers(); // obtain the array …

  4. java - How to return a specific element of an array ... - Stack Overflow

    Oct 15, 2013 · I want to return odd numbers of an array yet Eclipse doesn't seem to accept my return array[i]; code. I think it requires returning a whole array since I set an array as a …

  5. How to Return an Array in Java? - JavaBeat

    Nov 30, 2023 · Use the “return” keyword before the array name to return a single or multi-dimensional array in Java. The return of an array enhances the reusability and allows users to …

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

    Sep 26, 2024 · To return an array of items, perform the following steps: Declare a method with the object array you want to return as its return type. For example: Public MyClass [] …

  7. How to Return an Array in Java: An In-Depth Guide and Best …

    Dec 27, 2023 · The core principles of returning array references in Java; How to return variable array references step-by-step ; Techniques for directly returning array literal expressions; …

  8. How to Return an Array in Java [ With Explanation ]

    How to Return an Array in Java. createArray() method is used to return an array in java which accepts numbers from the user and return an integer array in..

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

    In Java, returning arrays involves creating an array within a method and then returning it to the caller. For simple built-in arrays, which are arrays of primitive data types like int, double, char, …

  10. 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 …

  11. Some results have been removed
Refresh