hi. my code works perfectly fine and meets all requirements yet it wouldn't accept my code. it accepts the declaration and initialization but won't accept this way of adding the names, even thought it works fine. in the end i had to delete the below line //write your code here ArrayList<String> seussList = new ArrayList<String>(Arrays.asList("Sam", "I", "Am")); and change it to the more tedious: ArrayList<String> seussList = new ArrayList<String>(); seussList.add("Sam"); seussList.add("I"); seussList.add("Am"); any ideas why, is just the literal interpretation of "Add the following words to the list: "Sam", "I", "Am". literally add()
why can't i use Arrays.asList?
You must be signed in to leave a comment
This page doesn't have any comments yet