mm, I think this is the easiest method but that method is very simple too :P
public A(){
ID = hashCode();
}
The only thing you have to be careful of is if you ever choose to override...
Type: Posts; User: helloworld922
mm, I think this is the easiest method but that method is very simple too :P
public A(){
ID = hashCode();
}
The only thing you have to be careful of is if you ever choose to override...
Alternatively, you can generate random numbers for the ID. However, do note that this method is not guaranteed to give you a unique ID every time.
If you want a completely unique number, I believe...
Will randomly generated ID's work? If not, you can always use the hashCode() function to assign a more or less unique ID as long as you use the default Object class's hashCode() method.
public...