Any pointers? Thanks
package com.codegym.task.task05.task0532;
import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;
/*
Task about algorithms
*/
public class Solution {
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(System.in);
int num;
int max = 0;
//write your code here
System.out.println("Please enter the amount of numbers you would like to enter : ");
int nAmount = scanner.nextByte();
ArrayList<Integer> maxNums = new ArrayList<>();
for (int i = nAmount; i > 0; i--) {
num = scanner.nextInt();
maxNums.add(num);
if (num == 0 || num < 0) return;
else {
max += num;
}
}
System.out.println(max);
}
}