Because getting returned values is not mandatory. It's generally not a good idea to ignore returned values, but there are time when you just don't care about the returned value. Look at Map#put(Object key, Object value), most of the time you will not use the returned value.
In the above code .when you invoke add() method you are creating an object .Once add methods finishes execution two things may happen-- 1.if you return that object and in main method you store that object reference in a reference variable.It indicates that object has active reference in your program,May be you want that later on in your program.
2.if you dont assign the reference of that object to any reference variabel whose scope is larger than method or if you dont return the object ,then that object is unreachabel after method execution.ie garbage collectible.
Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad: