How can I identify an anonymous inner class in a NotSerializableException

拜拜、爱过 提交于 2019-11-27 16:09:13

Board$1 is the first anonymous class encountered in Board.java. For example:

class Board {
  public static void main(String[] args) {
    new Object() {}; // Board$1
    new Object() {}; // Board$2
  }
}

With an IDE like Eclipse, it's easy to spot those anonymous classes in the outline view. I'm sure NetBeans has similar views:

In IntelliJ (and Android Studio) one can Navigate->Class (⌘-O on mac) and paste in Board$1, and it will take you to the code for that inner class.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!