Too many times I have to use a List of an Object instead of the object, If I use
MyObj a = null;
a.setParameter = 0;
It works. But If I use
List<MyObj> a = null;
MyObj b = getObjectFromSomewhere();
a.add(b);
It fails with error : java.lang.NullPointerException?
And How I can see If my new List<MyObj> a
is "null" or without any element inside?