Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

ENTERPRISE INTEGER SWAPPING

Name: Anonymous 2012-11-10 18:28


import java.lang.reflect.Field;

/**
*
* @author Soheil Hassas Yeganeh
* This class swaps the values stored in two Integer objects.
* Published under GPLv3.
*/
public class Swapper {
 public static void swap(Integer i, Integer j) {
  try{
   Integer lastJ = new Integer(j);
   Field value = Integer.class.getDeclaredField("value");
   value.setAccessible(true);
   value.set(j, i);
   value.set(i, lastJ);
   value.setAccessible(false);
  }catch(Exception e){
   e.printStackTrace();
  }
 }
 public static void main(String [] args){
  Integer i = 20;
  Integer j = 30;
  swap(i,j);
  System.out.println(" i is : " + i + " j is : " + j);
 }
}

Name: Anonymous 2012-11-11 14:12

>>6,8,9
Are you autistic? It's obviously satire.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List