I want to create a Map object that can lose value only if we explicitly delete it from map.
I have created Map object like
public static Map<Long,String> listUser =new HasMap<Long,String>();
but every time class object is created new instance of Map is also created that contain null value. I want to create a Map instance that contain value we stored before.
You are describing the default behavior of Maps, they remember entries. The problem I think you are having is that you probably need only one Map and not new instances. If you need a second map that has the contents of the first, look into “copy constructors” but your question as stated doesn’t suggest that would be a good idea.