ArrayList cannot find symbol | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

ArrayList cannot find symbol

I'm looking at this code and can't see where I made a mistake. edit:changed the code and it works! https://code.sololearn.com/cNTv5IMha03I/?ref=app

18th May 2018, 10:16 PM
noa
3 Respuestas
0
I could be wrong, but I didn't think you could run java code in the Sololearn playground. Thought it was limited to HTML, CSS and Javascript. Have you tried testing in Eclipse or Netbeans?
18th May 2018, 10:34 PM
Jose Ayala
Jose Ayala - avatar
0
Start the code and see. I'm full of doubts.
18th May 2018, 10:37 PM
noa
0
Cool, I didn't even realize you could run java code in the playground, learned something new today. I tried it with the imports and it worked, nice. import java.util.ArrayList; import java.util.Collections; public class Program { public static void main(String[] args) { ArrayList<Integer> list = new ArrayList<Integer>(); list.add(4); list.add(2); list.add(3); list.remove(2); Collections.sort(list); System.out.println(list.get(0)*list.size()); } }
18th May 2018, 10:59 PM
Jose Ayala
Jose Ayala - avatar