<< August 28, 2008 | Home | August 30, 2008 >>

Friday Java Quiz: Accidents Of Implementation

Do you own a copy of The Pragmatic Programmer? Have you ever been to a Dave Thomas talk at a developer conference? Then you no doubt have seen the following snippet of Java code (p.173):

paint(g);
invalidate();
validate();
revalidate();
repaint();
paintImmediately(r);

Here it looks like Fred is desperately trying to get something out on the screen. ...

Q: Can a valid Swing program be written that contains the above lines of code? (No trick answers.)

Q: In which Swing classes or interfaces are each of the above methods defined?

Q: What are the legitimate use cases of each of the methods?

Tags :