About 376,000 results
Open links in new tab
  1. java - How to use a method to return a double array of user input ...

    I want to create a method that returns a double array of user input values. I've figured out how to create a method to ask the user to pick how many elements an array should hold, then pass …

  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. java - How to obtain return type double? - Stack Overflow

    Feb 14, 2013 · if(myArrayList.size() >= 2) { Double t = myArrayList.get(myArrayList.size()-1); Double d = myArrayList.get(myArrayList.size()-2); result = ( t+ d ) / 2 ; …

  4. arrays - return type []double issue in java - Stack Overflow

    Jul 28, 2012 · return (new double[]{latitude,longitude}); So, what is difference between them? While java supports declarations data_type [] var_name as well as data_type var_name []. …

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

  6. Double Array in Java - Know Program

    An array in Java used to store multiple double values in a single variable called a double array. Example = {10.0, 15.9, 20.8, 45.5, 50.9}

  7. Java Arrays - How to return array in java from method?

    Nov 22, 2021 · Java Return Array - double [] primitive & wrapper array. Below example returns a double [] array from the method. Example 2: numbers[i] = i + 1; } return numbers; } // returning …

  8. Array getDouble () Method in Java - GeeksforGeeks

    Nov 30, 2018 · The java.lang.reflect.Array.getDouble() is an inbuilt method of Array class in Java and is used to return the element present at the given index from the specified Array as …

  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 Array in Java - Delft Stack

    Feb 2, 2024 · To do this, we use Arrays.toString() that takes an array as the only argument and converts the array to a string. String intArrayAsString = Arrays.toString(returnArrayInt()); . …

  11. Some results have been removed
Refresh