1

ToDo, Task not adding to the ArrayList

I can create new Task object, ArrayList of the Task, but when I'm trying to add (early created or to create it when adding) Task object to List, it says that "Cannot access todo.Task."

I was trying different things like, to make it inner class etc., and nothing doesn't work. An month ago i was creating a Pirate class and a Ship class. I had an ArrayList of pirates on the ship. And there was no problem with adding new pirates to ArrayList on the Ship.

Thanks for your answers!

I was trying make Task class inner, to import class, created package to make classes be in the same package, creating ArrayList in the Task class and then to refer to him from the ToDo class... I expect, just like i said above, simply, to add elements of class i created (Task) to ArrayList inside another class, like i was doing with Pirates.

Pirates

1
  • can you share the whole code for checking?
    – Arun
    Commented Dec 18, 2023 at 11:16

0