1 Answer. A local inner class consists of a class declared within a method, whereas an anonymous class is declared when an instance is created . So the anonymous class is created on the fly or during program execution.
1 Answer. A local inner class consists of a class declared within a method, whereas an anonymous class is declared when an instance is created . So the anonymous class is created on the fly or during program execution.