79671635

Date: 2025-06-19 06:51:04
Score: 3
Natty:
Report link

do you know how to properly override a Java varargs method in Scala so that it's still callable with variable arguments from both Scala and Java? I figured out that in Scala, you have to override the method using an Array (since that's how varargs work under the hood in Java), and then if you still want to call it using varargs from Scala, you can add a separate method that takes a String* and just forwards to the array version. That way both sides work properly.

Reasons:
  • Whitelisted phrase (-2): I figured out
  • RegEx Blacklisted phrase (2.5): do you know how
  • No code block (0.5):
  • Contains question mark (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Adithya R