Closed JaiDeves closed 7 years ago
You would only call the first method if tempArray1
is of type ArrayNode
and tempArray2
is of type ObjectNode
. Otherwise obviously the other overload is selected, since the types match there and not for the first overload. That's just how Java overloads work: The best fit wins.
Yes, working properly now, but it's too much widening i think. Thanks for your help.
Even though i'm calling this method
public Observable<Long> publish(final String topic, final EnumSet<PublishFlags> flags, final ArrayNode arguments, final ObjectNode argumentsKw){ }
like this,
client.publish(topic, PublishFlags.RequireAcknowledge, tempArray1, tempArray2)
Its calling
public Observable<Long> publish(final String topic, Object... args) { return publish(topic, ArgArrayBuilder.buildArgumentsArray(clientConfig.objectMapper(), args), null); }
Please help me with this........... Is there a problem with the Method overloading since you are using Object as varargs?