多选题 Given:
2. public class Buffalo {
3. static int x;
4. int y;
5. public static int getX() {return x; }
6. public static void setX(int newX) {x = newX; }
7. public int getY() {return y; }
8. public void setY(int newY) {y = newY; }
9. }
Which lines of code need to be changed to make the class thread safe? (Choose all that apply.)
【正确答案】 B、C、D、E、F、G
【答案解析】