I want to use a Jar in Scala, that is written in Java.
There are classes, that have multiple constructores, for example:
public LabeledDock(Parent<? super Labeled> parent, int index, Class<?> subtype){}
and
public LabeledDock(Parent<? super Labeled> parent, Class<?> subtype)
So the first constructor has 3 inputs, the second only 2 inputs.
If i want to use these constructors in Scala in that way:
val button = new LabeledDock(scene.asParent(), classOf[Button])
Scala tells me that "ambiguous reference to overloaded definition"
If i use
val button = new LabeledDock(scene.asParent(), 0, classOf[Button])
all works fine. So i think with the first variable declaration Scala doesn't know which constructor he should use, because they are similar to each other. How can i use the constructor with only 2 inputs instead of adding the third input.
Thanks for your help!
LabeledDock?