2 top level classes are not allowed in one java file. These classes should be separate. http://java.sun.com/docs/books/jls/second_edition/html/packages.doc.html#26783