How to instantiate inner class?

52 views
Skip to first unread message

Tomaž Kunaver

unread,
May 13, 2023, 6:43:54 AM5/13/23
to mozilla-rhino
Hi,
I am trying to figure out how (if it is possible at all) to instantiate an inner class from Rhino. This is basically the same qeustion as this one: https://groups.google.com/g/mozilla.dev.tech.js-engine.rhino/c/XPgGdKjx9s0/m/PtjEaCafYeEJ

Example from java:

OuterClass.InnerClass innerObject = outerObject.new InnerClass();

However, I'm not sure if I can do that in Rhino? Any ideas?

P

unread,
Oct 23, 2023, 9:37:37 AM10/23/23
to mozilla-rhino
Have you tried new Packages.OuterClass.innerObject()?

P

unread,
Oct 23, 2023, 9:41:02 AM10/23/23
to mozilla-rhino
Or otherwise:  var out = new  OuterClass  (); var in = new Out.InnerClass(out);
Reply all
Reply to author
Forward
0 new messages