how do you make a method that returns an array java
public static int[] numbers()
{
int[] arr={5,6,7,8,9}; //initializing array
return arr;
}
how do you make a method that returns an array java
public static int[] numbers()
{
int[] arr={5,6,7,8,9}; //initializing array
return arr;
}
how to return array in java
import java.util.Arrays;
public class trial1{
public static void main(String[] args){
int[] B = numbers();
System.out.println(Arrays.toString(B));
}
public static int[] numbers(){
int[] A = {1,2,3};
return A;
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us