Is there anyway to write this piece of if statement in switch statement in Java?
Object obj;
if (obj instanceof Integer){
}
if (obj instanceof Double){
}
....
This is just an example. Integer of Double could be replaced by any other object types
Aucun commentaire:
Enregistrer un commentaire