Skip to main content

Posts

Showing posts from 2015

How to write singleton class in java

Singleton class   public class MySingleton { private MySingleton(){ System.out.println("Creating new Instance"); }

Most popular Java Interviews Questions - A gavel, which most experienced java programmers resort to.

“Most popular Java Questions” - A gavel, which most experienced java programmers resort to. A set of simple questions, that are essentially useless, but the programming giants love to harp on these!! My verdict? I detest these futile questions!!

Spring - Bean Scopes

What is spring Bean scopes ? it is just an interview question which i have faced!!! A simple one.... Any way i couldn't answer it .  For the sake of next interview i am going to answer it in here: When defining a <bean> in Spring, you have the option of declaring a scope for that bean. For example, To force Spring to produce a new bean instance each time one is needed, you should declare the bean's scope attribute to be  prototype . Similar way if you want Spring to return the same bean instance each time one is needed, you should declare the bean's scope attribute to be  singleton .