The Sun Code Conventions and my book are unclear as to where inner class definitions go in the outer class's source file. I looked at the source for javax.swing.Timer, and it has one thrown in the middle of the methods - just below the method that uses it. I'm thinking I'll put my at the end of my source file after all the methods. Anyone have a definitive answer or at least a good argument one way or another? Personally, I find them to be distracting/confusing at the top of the file.
I'm not aware of any standard (but that doesn't mean that there isn't one). I would put it just above the method that uses it first. Now that might be just me and my Pascal background but I think that to be the most convenient.
Hi Pete, I don't know if there is a convetion on where to place inner classes. As Junilu stated he likes to put them near their first use. I prefer putting them at the very end of the enclosing class definition. Just be consistent with whatever you choose to do. Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher