using System;
class A
{
public static int X;
static A(){
X=B.Y+1;
}
}
class B
{
public static int Y=A.X+1;
static B(){}
static void Main(){
C.onsole.WriteLine("X={0},Y={1}",A.X,B.Y);
}
}
产生的输出结果是什么?
[主观题]在下面的例子里using System;class A{public A(){PrintFields();}public virtual void PrintFields(){}}class BA{int x=1;int y;public B(){y=-1;}public override void PrintFields(){C.onsole.WriteLine(x={0},y={1},x,y);}当使用new B()创建B的实例时,产生什么输出?
[主观题]在下面的例子里using System;class A{public A(){PrintFields();}public virtual void PrintFields(){}}class B:A{int x=1;int y;public B(){y=-1;}public override void PrintFields(){C.onsole.WriteLine("x={0},y={1}",x,y);}当使用new B()创建B的实例时,产生什么输出?
[试题]下面的代码中有什么错误吗?_______using System;class A{public virtual void F(){C.onsole.WriteLine("A.F");}}abstract class B:A{public abstract override void F();
[单选题]阅读下面程序 public class Increment { public static void main( String args[] ){ int c; c=5; System.out.println(C) ; System.out.println(c++); System.out.println(C) ; } }A.5 6 6B.5 5 6C.6 7 7D.6 6 6
[单选题]阅读下面程序 public class ConcatTest{ public static void main(String[] args) { String strl = "abc"; String str2 = "ABC"; String str3 = str1.concat(str2); System.out.println(str3); } } 程序的运行结果是:A.abeB.ABCC.abcABCD.ABCabc
[单选题]阅读下面程序 public class Increment { public static void main( String args[] ){ int c; c=5; System.out.println(C) ; System.out.println(c++); System.out.println(C) ; } }A.5 6 6B.5 5 6C.6 7 7D.6 6 6
[单选题]阅读下面代码 public class Jixiangwu { public static void main(String[] args) { String[] stars={"贝贝","晶晶","欢欢","迎迎","妮妮"}; System.out.println("你抽取的奥运吉祥物是"+ "“"+stars[(int)(stars. ______ *Math.random())]+"”"+"!"); } } 为保证程序能正确执行,程序中下画线处应填写的
[单选题]阅读下面程序 public class Increment } public static void main(String args[]) { int c; c=5; System.out.println(C) ; System.out.println(c++); System.out.println(C) ; } } 程序运行的结果是A.5 6 6B.5 5 6C.6 7 7D.6 6 6
[单选题]阅读下面程序 public class ConcatTest{ public static void main(String[] args) { String strl = "abc"; String str2 = "ABC"; String str3 = str1.concat(str2); System.out.println(str3); } } 程序的运行结果是:A.abeB.ABCC.abcABCD.ABCabc
[单选题]下面程序的输出为( )。 public class Test { public static void main (String args[]) { int x,y; x=1; y=2; System.out.println("The output is"+x+y); } }A.The output is xyB.The output is 3C.The output is 12D.The output is x=1 y=2