Answers for "Write a method that takes a parameter int size and returns an int[] array of that size."

0

Write a method that takes a parameter int size and returns an int[] array of that size.

public int[] makeArray(int size)
{
    int[] arr = new int[size];
    for(int i = 0; i < arr.length; i++)
        {
            arr[i] = 0;
        }
        return arr;
}
Posted by: Guest on March-18-2020

Code answers related to "Write a method that takes a parameter int size and returns an int[] array of that size."

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language