POV-Ray : Newsgroups : povray.off-topic : Unit Testing question : Re: Unit Testing question Server Time
30 Jul 2024 00:17:52 EDT (-0400)
  Re: Unit Testing question  
From: Le Forgeron
Date: 10 Jun 2011 11:05:30
Message: <4df232ba$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.