Groovy web console

subscribe to the feed Subscribe
to this
site

Late Binding

Published 6 years ago by RCP
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
public class Test {
  public static void main(String [] args) {
    String s = "Hello World";
    Object obj = s;
    new Test().method(obj);
  }
  public void method (String s) {
    System.out.println("String Value = " + s);
  }
  public void method (Object s) {
    System.out.println("Object Value = " + s);
  }
}