Skip to content

Java code snippet – How do you make a method that returns an array ?

public static int[] numbers()  
{  
int[] arr={5,6,7,8,9};  //initializing array  
return arr;  
}  
See also  How to get the current year in PHP?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.