If you are attempting to perform a util.getValue() to fetch the value after it is set, you will not get a value since you initialized the myVal String within your util.setValue(String str) method. In order to retrieve this value, you will have to create a class member that you would populate in the setValue(String str) method and retrieve via the getValue() method