How to extend a Java interface or class with overloaded methods using Nashorn?

A. Sundararajan sundararajan.athijegannathan at
Mon Feb 23 16:10:52 UTC 2015

Hi Christopher,

Somehow missed responding to this email. Yes, you can implement 
interface with overloaded methods. You can use arguments inside the 
implementing function to differentiate.

var Foo = Java.type('bar.Foo');
var instance = new Foo {
   bar: function(){
      for (i in arguments) print(arguments[i]);

Hope this helps,

More information about the nashorn-dev mailing list