This post originated from an RSS feed registered with Java Buzz
by Brian McCallister.
Original Post: Is it bad if I use pointers in Java?
Feed Title: Waste of Time
Feed URL: http://kasparov.skife.org/blog/index.rss
Feed Description: A simple waste of time and weblog experiment
final boolean[] val = new boolean[] { false };
mixed.forEach(new Closure()
{
public void execute(Object o)
{
val[0] = true;
}
});
in my unit tests for quick checks in order to get around the lack of explicit pointers in Java so that I can toggle a boolean in an anonymous inner class.
This feels like an awful hack, but does anyone know a better idiom?