Perhaps you could post the actual code and compiler message. The line looks OK, but the devil with compiling lies in the detail.

-----

In the class definition x and y should be private because...