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-10 20:11

that truly follows the ENTERPRISE PHILOSOPHY:

why do it in one line, when you can do it in twenty?

Name: Anonymous 2012-11-10 22:21

the funniest thing is that he didn't even implement swap()

Name: Anonymous 2012-11-10 22:22

>>3
public static void swap(Integer i, Integer j) {
/polecat kegabs/

Name: Anonymous 2012-11-11 1:53

This is beautiful. It's less verbose in other languages, and once you see it there, you appreciate it being in Java.

Name: Anonymous 2012-11-11 2:47

http://hackish.blogspot.com/2007/12/swapping-two-integers-in-java.html

I think (hope) this this is a kind of satire.

Name: Anonymous 2012-11-11 2:51

The following code is in response to ones arguing that C# is better than Java because it can swap two numbers!
LEL junior college

Name: Anonymous 2012-11-11 10:44

I find java to be extremely hilarious

Name: Anonymous 2012-11-11 13:53

>>6
The following code can also be used under GNU Public License v3 (http://gplv3.fsf.org/)
...for a code snippet to swap two integers?

This has to be a joke.

Name: Anonymous 2012-11-11 14:12

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

Name: Anonymous 2012-11-11 14:47

}catch(Exception e){
   e.printStackTrace();
}

Name: Anonymous 2012-11-11 16:23

java programmers might be a joke, but they take themselves very seriously.

Name: Anonymous 2012-11-11 17:08

>>10
The fact that we can't tell is a testament to how shitty Java really is.

Name: Anonymous 2012-11-11 17:17

>>12
Jokes are funnier if they take themselves seriously.

Name: Anonymous 2012-11-11 19:45

>>13
You Javelly?

That's a joke we have here at Oracle, it's Enterprise quality though, so you wouldn't understand it.

Name: Anonymous 2012-11-18 22:02

FIBONACCI BUTT SORT
Anti-spam bump

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