1. Declare a string list variable and immediately initialize it.
Found an annoying bug in this one, as it needs to be declared as; ArrayList<> xxx = new ArrayList<>();
I personally used the List<> xxx = new ArrayList<>(); but this will not let it pass. (its even been mentioned in the lesson before this one by CodeGym itself :) )
Please fix it for future students!
For the rest, i truly like the concept and enjoy everything else thusfar! great course, keep it up!
Annoying bug in this one
Archived
Comments (9)
- Popular
- New
- Old
You must be signed in to leave a comment
Regina Support Team at CodeGym
7 November 2019, 14:14
Thank you for the insight.
We will fix it asap.
0
sreedhar s
9 May 2021, 10:07
Hi Regina, This is not fixed till date ? Can you please fix this asap as its reported more than an year ago and it should take both list and ArrayList, otherwise the question is misleading to the future students.
0
Regina Support Team at CodeGym
12 May 2021, 08:05
Hi!.
Sure. After the next release, it is going to be fixed. The task was under revision for some period of time.
0
Kent Hervey Software Engineer/Consult Expert
6 November 2019, 19:27
Yes. My instruction has said better to use List interface as type versus ArrayList, so I tried it, too.
0
Jiří Martínek
10 May 2019, 10:42
Thanks a lot!
0
Bert Doe
18 April 2019, 09:39
OMG, thank you for this. Was pulling my hair out, had no idea what I was doing wrong!
0
Oleh
17 April 2019, 08:19
All tasks in first 20 lvls are completable. If you wanna to get help you should show all your code.
But if you did exactly like you said above then there is mistake in your code.
"1. Declare a string list variable and immediately initialize it. "
that means code must be like this:
0
Roy
17 April 2019, 08:27
Yes this is exactly how i did it.
I cant send the whole code here as it would show the solution as well.
However, in the next tasks after this one the same bug appears.
You cant finish the task with the code written the way we did using List.
You only are able when you write it as:
+3
Kent Hervey Software Engineer/Consult Expert
6 November 2019, 19:32
Roy is right.
See: https://stackoverflow.com/questions/2279030/type-list-vs-type-arraylist-in-java
0