Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
class A {
    private int member = 20;

    private voidString method()
    {
      return "hello";
    }

    def publicMethod (String name_)
    {
      def localVar = member + 5;
      def localVar2 = "Parameter: name_";
      return {
        // Fails!
        println "${member} ${name_} ${localVar} ${localVar2} ${method()} ${bMember}"
      }
    }
  }

  class B {
    private int bMember = 12;

    def bMethod (String name_)
    {
      A aInsideB = new A();
      return (aInsideB.publicMethod (name_));
    }

  }

  B aB = new B();
  closureVar = aB.publicMethodbMethod("Xavier");
  closureVar();

...