DevOps / BeanShell Interview questions
Describe a scripted method in BeanShell?
A scripted method is a method defined directly in a BeanShell script, outside of any class, using ordinary method syntax like int add(int a, int b) { return a + b; }.
Once defined, it can be called just like any other method for the rest of that script's execution, and its parameter types can be explicit, as shown, or left loosely typed depending on how strictly the script needs to enforce argument types.
This is one of BeanShell's core scripting conveniences over plain Java, since Java requires every method to live inside a class, while BeanShell lets a script define and call standalone methods directly at the top level.
More Related questions...