public class Main
{
public static void Main(String[] args)
{
String [] arr = {"10", "20", "30", "40", "50"};
reverse(arr);
}
public String[] reverse(String[] arr)
{
for(int i=arr.length-1;i>=0;i--)
System.out.print(arr[i] + " ");
}
}
I'm trying to reverse the array. The error says non-static method reverse(String[]) cannot be referenced from a static context