title: generating unique string for each java object instance
body: <p>I need to write a function which returns a string which should be unique for each state of the object.</p>
  
  <p>i.e. if any of the instance variables are changed, then this method should return another string which should be unique for the given set of instance variables of object.</p>
  
  <p>Similarly I would later require write another method which represents unique static state of the class.</p>
  
  <p>Please suggest any efficient ways to achieve my requirement.</p>
  
  <p>Thanks,
  Harish</p>