156k views
4 votes
Write a program that passes an unspecified number of integers from command line and displays their total.

1 Answer

4 votes

Answer:

Step-by-step explanation:

I will go straight to the code, and hope it didn't confuse you.

Here is it

public static void main(String[] args)

int [] x = new int [args.length]

for (int y = 0; y< args.length;yi++)

int[y] = (int) args [y]