3.5 Implementing a Java Interface

Scripts written in NOC Script can implement a Java* interface, because the environment is hosted under Java. This uses a special syntax, similar to Java “inner class” declarations, and similar to the object declaration syntax introduced above. An example:

var runnable = new java.lang.Runnable()
{
    run: function()
    {
        writeln( 'Yep, running on a thread, all right!' )
    }
}
var thread = new java.lang.Thread( runnable )
thread.start()