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
3 odpowiedzi
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?
0
Start the code and see. I'm full of doubts.
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());
}
}