Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

private static Logger logger = Logger.getRootLogger();

 
Sowm Herur
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The following declaration:

private static Logger logger = Logger.getRootLogger();
In this declaration what is a Logger and logger?

and how come they are able to access the method getRootLogger() without creating the object?

Please clarify..
 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Logger ir a class. logger is instance of Logger.

Logger class may contain static methods that will be accessable without creating instance of class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic