1
I just can’t use any method of the Arraylist class (always gives compilation error) and I have no idea why. Am I making some syntax error? I didn’t get any answers searching the internet. I put photos to demonstrate exactly the problem. It’s like he doesn’t recognize the "."
The commented lines are because I was going to test the methods of the class (I’m still learning to program), but they all gave error when I tried to run, so I commented the lines to make the command prompt leaner. The error was exactly the same on all lines (the one shown in the image).
import java.util.ArrayList;
public class ArrayList {
public static void main (String[] args) {
ArrayList cores = new ArrayList();
cores.add("Branco");
}
}
Add the code in text instead of image, as it hinders anyone who helps you test the code. Read that
– user28595