Groovy web console

subscribe to the feed Subscribe
to this

Delegate property overwrite method

Published 8 months ago by Felix Scheinost
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class Base {
  String getString() {

class Impl extends Base {
  String string = "bar"

class Delegating {
  Impl sub = new Impl()

assert new Delegating().string == "bar"