Good evening everyone,
i want to make a program that read a list of integers as an array then prints the reverse of it however these integers should be passed as command line arguments but my program won't compile can somebody tell me what to do
import java.util.Arrays; public class Reverse { public static void main(String[] args) { for (int i = 0; i <= args.length - 1; i++) { int[] numbers = Integer.parseInt(args[i]); reverseInPlace(numbers); } } public static void reverseInPlace(int[] a) { for (int i = 0; i <= (a.length - 1) / 2; i++) { int temp = a[i]; a[i] = a[a.length - 1 - i]; a[a.length - 1 - i] = temp; } System.out.println(Arrays.toString(a)); } }