Rohit Kejriwal wrote:it showed NonThreadSafeSingleton Error.
Just FYI, that's a warning, not an error.
A warning doesn't mean you've done something illegal in the language, and it won't prevent a .class file from being generated. It just means you've done something that could lead to unexpected or undesirable behavior.
An error means you've violated the rules of the language, and prevents a .class file from being produced.