1public static int[] numbers()
2{
3int[] arr={5,6,7,8,9}; //initializing array
4return arr;
5}
1import java.util.*;
2public class Main
3{
4public static String[] return_Array() {
5 //define string array
6 String[] ret_Array = {"Java", "C++", "Python", "Ruby", "C"};
7 //return string array
8 return ret_Array;
9 }
10
11public static void main(String args[]) {
12 //call method return_array that returns array
13 String[] str_Array = return_Array();
14 System.out.println("Array returned from method:" + Arrays.toString(str_Array));
15
16 }
17}
18