Hello fellow programmers.
I have a question about static and the dot operator using this example in Java.
So I have this class variable declaration of an ArrayList inside my Inventory class.
static List<Multimedia> list = new ArrayList<Multimedia>();
If I choose to use the add method of the ArrayList in the method, should I write the method call like this: Inventory.list.add(Object o) or should I use list.add(Object o). Do they mean the same thing? If they are not, which method call should I use?
Outside the class you have to access it via the class name (but it depends on the access modifier i.e private cannot be accessed outside the class), inside the class you could use either of them.