Вызывается ли конструктор по умолчанию во время внедрения bean-компонента?JAVA

Программисты JAVA общаются здесь
Гость
Вызывается ли конструктор по умолчанию во время внедрения bean-компонента?

Сообщение Гость »


Lets say I have class A and B

class A{ } class B{ A a; B(){ System.out.print("Hello"); a = something; } } Now I have a bean.xml file where I create a bean of A and B and inject A into B. If the default constructor is called while creating the bean of B, will the value of property A be overwritten by bean injection?


Источник: https://stackoverflow.com/questions/781 ... -injection

Вернуться в «JAVA»