题目详情
单选题 下列【1】、【2】、【3】、【4】注释标注的哪行代码有错误?( ) class Tom { int x; static int y; void showXY(){ System.out.printf("%d,%d\n",x,y); } static void showY() { System.out.printf("%d\n",y); } } public class E { public static void main(String aqgs[]){ Tom.y = 100; //【1】 Tom cat = new Tom(); cat.x = 100; cat.y = 200; //【2】 Tom.x = 300; //【3】 cat.showXY(); Tom.showY(); //【4】 } }

学科:默认课程
时间:2025-12-09 15:04:23
