Advertisement
Guest User

Untitled

a guest
Dec 27th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. private Logger() {
  2. // private constructor for singleton
  3. }
  4.  
  5. public class LoggerHolder { // non static inner class
  6.  
  7. public static final int x =10; // No compile here
  8.  
  9. public static final Logger4 logger = new Logger4(); //Compile error
  10. }
  11.  
  12. public static Logger getInstance() {
  13.  
  14. return LoggerHolder.logger;
  15. }
  16.  
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement