Java - Confused by the one class per file rule
<p>The one class per file rule in Java has me a bit confused. I writing an Android app and trying to implement the accepted answer to this question:</p>

<p><a href="http://stackoverflow.com/questions/3291490/common-class-for-asynctask-in-android">Common class for AsyncTask in Android?</a></p>

<p>which calls for an interface definition which class A implements and class B accepts as an argument to its constructor.</p>

<p>So I need an A.java and a B.java, but where does the interface go? Does it need a separate java file itself? Do I have to define it inside both A and B? If not how to import it?</p>

<p>Also I will have about 10 different AsyncTask classes, but I don't want to bother creating a new file for each one.  What would you recommend? Is there a way to put all 10 classes in one file? Or should I create a big if/then block inside the class and pass an argument telling it which of the 10 different tasks I want it to do?</p>
