TclBlend: Blending Tcl and Java
By Scott Stanton
Dr. Dobb's Journal February 1998
<B>(a) </B> public class OverloadedSample { OverloadedSample(String s); OverloadedSample(int i); } OverloadedSample x = new OverloadedSample(42); OverloadedSample y = new OverloadedSample("42"); <B>(b)</B> set x [java::new { OverloadedSample int } 42] set y [java::new { OverloadedSample String } 42]
Example 2: (a) Multiple constructors that take the same number of arguments; (b) how a script identifies which constructor should be used.
Copyright © 1998, Dr. Dobb's Journal