Create an instance of Abstract Class through Spring
posted 7 years ago
As per the java rule we cannot Instantiated Abstract class, thats 100% right.
But my confusion arise when i saw the strange behavior in Spring, that, i have created one Abstract class and in that i have created on lookup method and thats also abstract.Then in my Spring config file i have written the below code:
and i run my container and this bean initialized successfully, but when i remove the code <lookup-method name="getLatestObjectOfBean" bean="beanToGetFromLookupMethod"/> from above bean defination then it starts giving error which is right that it should not create an instance of Abstract Bean.