Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

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

Options
  • 30-11-2021 7:01am
    #1
    Registered Users 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