Hello codegym colleagues!
I tried to run the code with List<String> stringX = new ArrayList<String>(); but it kept on failing.
Once I have changed the line to an ArrayList - ArrayList<String> stringX = new ArrayList<String>(); it passed.
Shouldn't the requirement be to create an ArrayList rather than a list?
This was confusing as in the previous exercise we used a list by declaring it private static List<String> strings;
I fell like sometimes that the requirements are not well explained. Does anyone else feel the same?
Question about the requirements
Archived
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Nouser
10 December 2020, 07:05
In the syntax quest the validator is really strict. Later it gets somewhat better. Here I assume that CodeGym relies on you following their hint on the Practice with ArrayList task page:
Hint 3:
'Create a list of strings' most often means the following: ArrayList<String> list = new ArrayList<String>();
+1
Mihai Bone
9 December 2020, 21:04
I think it will work this way also, there is a difference if you start with List or with ArrayList (I don't know it i'm to lazy to google it)
+1