About 293,000 results
Open links in new tab
  1. pass array to method Java - Stack Overflow

    Feb 6, 2012 · you have to use java.util package; array can be passed by reference; In the method calling statement. Don't use any object to pass an array; only the array's name is used, don't …

  2. Passing an Array to a Function in Java - GeeksforGeeks

    Nov 13, 2024 · In this article, we will check how to pass an array as a method parameter. Let function GFG () be called from another function GFGNews (). Here, GFGNews is called the …

  3. How to Pass an Array to a Method in Java | Delft Stack

    Feb 2, 2024 · In the method declaration, we need to tell Java that the method must accept an array of a certain data type to pass an array to a method. Use the data type of the array and …

  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. Java Methods - W3Schools

    To call a method in Java, write the method's name followed by two parentheses () and a semicolon; In the following example, myMethod() is used to print a text (the action), when it is …

  6. Pass Arrays to Methods in Java - Online Tutorials Library

    Learn how to pass arrays to methods in Java with clear examples and explanations.

  7. Passing Array to Function In Java - Tpoint Tech

    In this section, we will learn how we can pass an array to a user-defined function and will notice how it makes the code more optimistic as well as efficient. Generally, the purpose of passing …

  8. Passing Arrays to Methods in Java - Scientech Easy

    Feb 14, 2025 · To pass an array as an argument to a method, specify the name of array without any brackets. For example, if array num is declared as: then the method m1 () call. Here, we …

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

  10. Java Pass Arrays to Methods - JavaBitsNotebook.com

    Example: Fill an array with 10 integer values. Pass the array to a method that will add up the values and return the sum. (In this example, no original data in the array will be altered. The …

Refresh