I totally agree with the opinion that premature optimization is something to avoid.
But it's true that the Java VM has special bytecodes which could be used for switch()'s.
See WM Spec (lookupswitch and tableswitch)
So there could be some performance gains, if the code is part of the performance CPU graph.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…