How can I check if a list is empty? If so, the system has to give a message saying List is empty. If not, the system has to give a message saying Li
As simply as:
if (numbers.isEmpty()) {...}
Note that a quick look at the documentation would have given you that information.