About 9,240,000 results
Open links in new tab
  1. Array get() Method in Java - GeeksforGeeks

    Jul 23, 2020 · The java.lang.reflect.Array.get() is an inbuilt method in Java and is used to return the element at a given index from the specified Array. Syntax Array.get(Object []array, int index)

  2. java get all values of an array in a method - Stack Overflow

    String str = Arrays.toString(array).replaceAll(",|\\]|\\[", ""); e.g. int[] array = {771, 11, 141, 1, 11, 79, 7}; String str = Arrays.toString(array).replaceAll(",|\\]|\\[", ""); System.out.println(str);

  3. How to Return Multiple Values From a Java Method - Baeldung

    May 11, 2024 · In this tutorial, we’ll learn different ways to return multiple values from a Java method. First, we’ll return arrays and collections. Then we’ll demonstrate how to use container …

  4. 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 [] …

  5. Return an Array from a Method in Java - Online Tutorials Library

    Learn how to return an array from a method in Java with this comprehensive guide. Understand the syntax and examples for effective implementation.

  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. Java Arrays - How to return array in java from method?

    Nov 22, 2021 · A quick guide on how to return arrays in java from methods for primitive, objects and multidimensional arrays.

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

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

  10. How to return multiple values? - W3docs

    There are a few different ways to return multiple values from a method in Java: Use an array: You can create an array of the values you want to return, and return the array. The calling method …

  11. Some results have been removed
Refresh