Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Query: The Import java.util.ArrayList cannot be resolved Java

  • 30-11-2021 06:01AM
    #1
    Registered Users, Registered Users 2 Posts: 1


    Hello All, I am facing some issues while I am trying to run this java program in vs code 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);
        }
    }
    
    Tagged:


Comments

Advertisement