top of page

java getSimpleName returns empty string

  • Writer: Krishna Chaitanya
    Krishna Chaitanya
  • Jun 3, 2018
  • 1 min read

This happens when getSimpleName() method is called on an anonymous class.

The following is the output of the class names for normal class and anonymous class.

As you can see canonical name is null in this case.

Comments


©2018 by fundamentals. Proudly created with Wix.com

bottom of page