Java create a unique ID for each instantiated object using instance methods instead of class/static methods
问题 Quite new to this so I hope I have the terminology in the title right. I am trying to figure out how to create an instance method that will do the following: --An ID number is returned. --As each object is created from the class constructor(instantiated?), a unique integer ID number is assigned to it. The first ID number is 1, and as new objects are instantiated, successive numbers will be assigned. I am able to find examples of class/static methods that do the above however I am unable to