• Post Reply Bookmark Topic Watch Topic
  • New Topic

private static Logger logger = Logger.getRootLogger();  RSS feed

 
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..
 
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.
 
The glass is neither half full or half empty. It is too big. But this tiny ad is just right:
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!