IsimplycannotuseanyArrayListclassmethod(italwaysgivescompilationerror)andIhavenoideawhy.AmImakingasyntaxerror?Ididnotgetanyanswersbysearchingtheinternet.Itookpicturestodemonstrateexactlytheproblem.It'sasifhedoesnotrecognizethe"."
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 execute, so I commented the lines to leave the command prompt leaner. The error was exactly the same on all lines (as shown in the image).
import java.util.ArrayList;
public class ArrayList {
public static void main (String[] args) {
ArrayList cores = new ArrayList();
cores.add("Branco");
}
}