2

Assume I have:

<bean id="a1_beanId" class="com.rudziankou.MyUnusedClass" lazy-init="true" >
</bean>

I have never use this bean during app run.

Questions:

  1. Will com.rudziankou.MyUnusedClass be loaded by Class Loader?
  2. Do we have access to change default spring class loading behavior?
Rudziankoŭ
  • 10,681
  • 20
  • 92
  • 192
  • Read http://stackoverflow.com/a/32090706/1793718 & http://docs.spring.io/spring/docs/2.0.x/reference/beans.html#beans-factory-lazy-init – Lucky Aug 01 '16 at 09:15
  • @Lucky, from my understanding `Class Loading` and `instantiation` are different things, aren't they? – Rudziankoŭ Aug 01 '16 at 09:23
  • @Rudziankoŭ, yes you're right. Class loading is being handled by the Class loader in Java, and it means making the class available in the JVM. Instantiation is creating new instance of the class using `new` or `class.forName()`. From my understanding loading of class in Java happens as soon as another class references it. Anyways, there a so many experts here and I'm interested for their answers too. – Rae Burawes Aug 01 '16 at 11:32

0 Answers0