Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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

  • 30-11-2021 07: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