Query: The import java.util.ArrayList cannot be resolved Java
Hello All, I am facing some issues while I am trying to run this java program in vscode on online compiler but it shows an error on the 2nd line (The import java.util.ArrayList cannot be resolved Java(268435846)) and 6th line. But it gives correct output in an online compiler. Any suggestions?
import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
public class CollectionDemo {
public static void main(String args) {
ArrayList al = new ArrayList();
al.add(100);
al.add("String");
System.out.println(al);
}
}
Bitte markiere auch die Kommentare, die zur Lösung des Beitrags beigetragen haben
Content-ID: 1570919219
Url: https://administrator.de/contentid/1570919219
Ausgedruckt am: 21.11.2024 um 20:11 Uhr
1 Kommentar
This runs correctly in the online compiler
https://www.interviewbit.com/online-java-compiler/
same here
https://tio.run/##dY2xCoMwEEBn8xWHUxwa7CwdStdujqXD1YjEnokkp0WK325jBZfS6b ...
https://www.interviewbit.com/online-java-compiler/
same here
https://tio.run/##dY2xCoMwEEBn8xWHUxwa7CwdStdujqXD1YjEnokkp0WK325jBZfS6b ...
import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
class main {
public static void main(String args) {
ArrayList al = new ArrayList();
al.add(100);
al.add("String");
System.out.println(al);
}
}
(The import java.util.ArrayList cannot be resolved Java(268435846))
If you get this error you do not have defined the correct java library for your project, or include pathes are faulty.