阅读以下程序public static void Main(){Dog myDog = new Dog();Dog yourDog = new Dog();yourDog = myDog;myDog.name = “My Dog”;yourDog.name = “Your Dog”;}则以下说法不正确的是()
A. myDog和yourDog不是同一个对象。
B. myDog和yourDog是同一个对象。
C. myDog.name和yourDog.name的值相等。
D. myDog.name的值为“Your Dog”。
阅读以下程序class Test{int x;static int y;void F(){x = 1; //Line:1y = 1; //Line:2}static void G(){x = 1; //Line:3y = 1; //Line:4}}程序中哪一句是错误的()
A. Line:1
B. Line:2
C. Line:3
D. Line:4
阅读以下程序public class Count{static int count;int number;public Count(){count = count + 1;number = count;}}class Test{public static void Main(){Count a = new Count();Count b = new Count();Count c = new Count();}}程序运行后,对象a的number值是()
A. 0
B. 1
C. 2
D. 3
阅读以下程序public class Count{static int count;int number;public Count(){count = count + 1;number = count;}}class Test{public static void Main(){Count a = new Count();Count b = new Count();Count c = new Count();}}程序运行后,对象b的number值是()
A. 0
B. 1
C. 2
D. 3