if (object instanceof Integer) {
   Integer.parseInt(object.toString());
}

 

很简单是不是?我就想提醒下自己,java有个特殊词能判断种类,这个设计思路老记不住。typeof什么的,前端写多了。

相关文章: