Tuesday, February 18, 2014

Why do we declare Loggers static final?

  • private - so that no other class can hijack your logger
  • static - so there is only one logger instance per class, also avoiding attempts to serialize loggers
  • final - no need to change the logger over the lifetime of the class

Java Error: Cannot make a static reference to the non-static method

This error occurs when you access a method with out creating object of the class where the method belongs.

Friday, February 14, 2014

could not locate named parameter [userId1]

This is occurred due to you have set the Parameter in the map but there is not place holder for this parameter to map.