This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why am I not getting main when getName() is applied to the main method?

 
Erandika Withanage
Greenhorn
Posts: 14
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to get the name of the thread running the main() method and my code is as follows.



When execured, what I get is:



I don't get this. According to K&B the thread name should be 'main'? Is it a problem with my settings or IDE (DrJava)?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't call it a "problem" with your IDE, but it is a consequence of using one. Run the code from the command line to see the difference.
 
Erandika Withanage
Greenhorn
Posts: 14
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. It works perfectly now.

Just wondering about the underlying reason?

Seems there's no escaping the good ole' command line.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic