CollectionUtilsisNotEmptynew ArrayList
The code CollectionUtils.isNotEmpty(new ArrayList) will not compile because the ArrayList class is not parameterized.
To make it compile, you need to specify the type of elements the ArrayList will hold. For example, if you want an ArrayList that holds String elements, you can use new ArrayList<String>().
So the correct code would be:
CollectionUtils.isNotEmpty(new ArrayList<String>());
原文地址: https://www.cveoy.top/t/topic/hQwi 著作权归作者所有。请勿转载和采集!