79330707

Date: 2025-01-05 12:36:52
Score: 1
Natty:
Report link
List<String> list=new ArrayList<String>(Arrays.asList("baby", "ball", "soap", "baby", "shampoo", "chalk", "soap", "makeup", "baby", "lotion"));

This is one method that you can assign the ArrayList in a single line.I did not faced any issue as of now using this method

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Teja Reddy