Subj : Implementing Java Interfaces NOT using Rhino To : netscape.public.mozilla.jseng From : Keno Albrecht Date : Wed Jul 14 2004 08:30 pm Hello, I was wondering how to implement Java interfaces using JavaScript as part of a Mozilla extension. Possible solutions seem to work only using Rhino, for example, the "default" example // import some classes from Java. var Enumeration = java.util.Enumeration; // an array to enumerate. var array = [0, 1, 2]; // create an array enumeration. var elements = new Enumeration() { index: 0, elements: array, hasMoreElements: function() { return (this.index < this.elements.length); }, nextElement: function() { return this.elements[this.index++]; } }; exits with "missing ; before statement" (pointing to "new Enumeration() }", while // create an array enumeration. var elements = new Enumeration( { index: 0, elements: array, hasMoreElements: function() { return (this.index < this.elements.length); }, nextElement: function() { return this.elements[this.index++]; } }); (different braces!) fails with "Java class java.utils.Enumeration is abstract and therefore may not be instantiated" :-(. Well, since this is a really useful feature, I would like to use it within my code. Any comments? Thanks, Keno .