|
![](/i/fill.gif) |
Le 10/06/2011 16:45, Darren New a écrit :
> On 6/10/2011 1:18, Le_Forgeron wrote:
>> For instance, in Java, you can redefine the value of 3 and 6.
>
> Of all the languages out there, I'm pretty sure Java isn't one of those.
> :-) How do you redefine 3 to be 14?
three years late slogan (for the USA): Yes We Can...
http://thedailywtf.com/Articles/Disgruntled-Bomb-Java-Edition.aspx
basically:
import java.lang.*;
...
Field field = Integer.class.getDeclaredField( "value" );
field.setAccessible( true );
int i=3;
field.setInt(i,14);
...
Integer a = 2;
Integer b = 3;
System.out.println( a + b );
--
Software is like dirt - it costs time and money to change it and move it
around.
Just because you can't see it, it doesn't weigh anything,
and you can't drill a hole in it and stick a rivet into it doesn't mean
it's free.
Post a reply to this message
|
![](/i/fill.gif) |