Java – how to identify anonymous inner classes in notserializableexception
Trying to debug the application in NetBeans received the following error message:
During debugging, I have to insert "implements serializable" in many classes, because exceptions will occur during reading from the file storing large objects This is not difficult because the classes that need attention are already clear in the exception message What throws me is the obvious anonymous inner class' board $1 ' I can't find the "board" source of problems for my life How can I do this?
Because this is a debugging exercise, not the details of the code (I think) I didn't include it, but if it helps, I can easily add it
Solution
Board $1 is board The first anonymous class encountered in Java For example:
class Board { public static void main(String[] args) { new Object() {}; // Board$1 new Object() {}; // Board$2 } }
Using an IDE like eclipse, it's easy to find these anonymous classes in the outline view I'm sure NetBeans has a similar view: