The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

A path

Posted by Ivan Villanueva on January 23, 2001 at 4:52 PM

Hi,
this question is for me very interesting too.
What about so a function?:

static Object[] swap(Object a, Object b) {
a.getClass().getClassLoader()[] r = {b,a} ; // (1)
return r ;
}

(1) doesn't work. I don't know how this can be done. It is posible? But if it would work, swap would be a function for all objects, and then:

AnyObjectType temp[] = swap(a,b) ;
a = temp[0] ; a = temp[1] ;



Replies:
  • Re: karthik January 23, 2001 at 10:00 PM (0)

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us