What package did you put this file in? You must add the package <package name>; declaration at the top of the file.