Making/Allowing single execution of method, in Java
<p>I have a class with two methods load() and getValue(). The load function loads a set of key value pairs from a file onto a hashMap and the getValue(Object key) method is used to extract values for keys passed to it. </p>

<p>My problem is that I want to create an Object of the class such that load() should be executed only once (to load values into memory) and thereafter the getValue() method should be able to work on this data, each time its called. </p>

<p>What is the best approach to solve this problem? I am quite new to Java and OOP, so please feel free to modify either the question or the title to make it more clear. </p>
