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);
}
}
Please also mark the comments that contributed to the solution of the article
Content-ID: 1570919219
Url: https://administrator.de/contentid/1570919219
Printed on: September 19, 2024 at 12:09 o'clock
1 Comment
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.