I'm not sure whether you mean synchronize on a static variable (as Stan addressed) or synchronize the variable itself (as gaurav addressed).
To expand on what gaurav said, you can't apply "synchronized" to the variables themselves. But you can make the variables private, and use synchronized getter and setter methods to access them. Alternatively, you could use a synchronized block (as shown in Stan's example).
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org