• Post Reply Bookmark Topic Watch Topic
  • New Topic

Eclipse and getClass  RSS feed

 
Lena Sergeenko
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aloha, ranchers!

Anybody knows how to fix this one in Eclipse (or in the code LOL)

When executing this


the output is:

Employee 0 is a deitel.ch_10.SalariedEmployee
...

e.g. it prints out the package name deitel.ch_10.

Is there any way to remove it, maybe something in the settings how to change representation?

Thanks, rancheroes!
 
Campbell Ritchie
Marshal
Posts: 56576
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is the name of the class. Package name and class name.

Try getSimpleName instead.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!