Based on Method: Object.hashcode ();
The principle of hashcode ():
The hash value itself is a hash code, in short, each object corresponds to a hash value (int), so the role of hashcode in a timely and globally unique indicator;
In the same run environment, the hashcode value is unique so that you can distinguish between objects that are physically not the same as the class instance
However, for example
String obj_a= "AAA";
String obj_b= "AAA";
Obj_a,obj_b is the same, because the reason for the Java String Pool optimization is that each declaration of a string, the JVM will first look for a "string pool" to see if there is the same string, if there is an existing object reference returned, rather than a new string object, the same
String obj_a = new String ("BBB");
String obj_b = new String ("BBB");
is also the same hashcode, in general equals the same words, hashcode should be the same
So use
Switch (Object.hashcode ());
It's all right.
Android switch cannot use the workaround for class such as parameter String,view