Here, the first argument will correspond to the first parameter of each method, and then the parameter will be mapped.
I suggest a solution below to help eliminate ambiguity
If you want to call your first constructor, use
<bean id="triangle" class="org.tester.Triangle"> <constructor-arg type="int" value="20" /> <constructor-arg type="java.lang.String" value="10" /> </bean>
If you want to call your second constructor, use
<bean id="triangle" class="org.tester.Triangle"> <constructor-arg type="java.lang.String"value="20" /> <constructor-arg type="int" value="10" /> </bean>
So, to eliminate the ambiguity
EDIT: -
Read more about this issue here .
source share