Re: [tcljava-user] java::cast issue.
Brought to you by:
mdejong
From: Mo D. <md...@un...> - 2005-10-27 23:50:27
|
On Thu, 27 Oct 2005 17:04:24 +0800 <PFi...@hb...> wrote: > I have an issue with java::cast. > nodeAgent = (ObjectName)s.iterator().next(); The cast to ObjectName is done with the result of the next() invocation. The following example should make the order of operations clear. Note that "(Two) obj1.foo()" and "(Two) (obj1.foo())" would give the same result. public class Ex { static class One { Two foo() { return new Two(); } } static class Two {} public static void main(String[] args) { One obj1 = new One(); Two obj2 = (Two) obj1.foo(); Two obj3 = (Two) (obj1.foo()); System.out.println("OK"); } } > This email is a confidential communication ... Patrick, please read the mailing list terms of use. In particular, the part on fictional contract claims. If you are unable to post without these invalid disclaimers then please find another email address to post from. http://tcljava.sourceforge.net/docs/website/mail.html Mo DeJong |