I have a class for objects ... lat\'s say apples.
Each apple object mush have a unique identifier (id)... how do I ensure (elegantly and efficiently) that newly crea
Have you thought about using UUID class. You can call the randomUUID() function to create a new id everytime.