6、在C#中,下列代码的输出结果是()。 class Test { public enum WeekDays { Mon, Tue, Wed, Thur, Fri, Sta, Sun } static void Main() { WeekDays week = (WeekDays)2; Console.WriteLine(week); } }

6、在C#中,下列代码的输出结果是()。 class Test { public enum WeekDays { Mon, Tue, Wed, Thur, Fri, Sta, Sun } static void Main() { WeekDays week = (WeekDays)2; Console.WriteLine(week); } }


参考答案和解析
11

相关考题:

有变量定义如下: type weekday=(mon,tue,wed,thu,fri,sat,sun); workday=mon..fri; var day1:weekday; day2:workday; 下列不正确的语句是( )。 Aday1:=wedBday2:=wedCday1:=day2Dday2:=sun

下列程序段的输出结果是【 】。public class Test {void printValue(int m) {do {System.out.println("The value is"+m);}while (--m>10);}public static void main (String args[]) {int i=10;Test t= new Test();t.printValue(i);}}

下列代码的执行结果是( )。 public class Test { public static void main(String args[]) { System.out.println(7/2); } }A.3.5B.3C.3.0D.3.50

下列代码的运行结果是( )。 public class Test { public static void main(String args[]) { System.out.println(89>>1); } }A.44B.45C.88D.90

阅读下列代码 public class Test 2005{ public static void main(String args[]){ System.out.println((3>2)?4:5); } } 其运行结果是A.2B.3C.4D.5

阅读下列代码 public class Test{ public static void main(String args[]){ System.out.println(89>>1); } } 其运行结果是A.44B.45C.88D.90

( 21 )阅读下列代码public class Test2005{public static void main(String args[]){System.out.println((32) ? 4 : 5) ;}}其运行结果是A ) 2B ) 3C ) 4D ) 5

( 22 )阅读下列代码public class Test{public static void main(String args[]){System.out.println(891) ;}}其运行结果是A ) 44B ) 45C ) 88D ) 90

( 8 )阅读下列代码public class Test2{public static void main(String args[]){System.out.println(5/2);}}其执行结果是 【 8 】 。

请在下划线处填入代码,是程序正常运行并且输出 “ Hello! ”Class Test 【 15 】 {Public static void main (String[] arge){Test t = new Test();t.start();}Public void run(){System.out.println( “ Hello! ” );}

下列代码的执行结果是( )。 public class Test{ public static void main (String args[ ]){ System.out.println(5/2): } }A.2.50B.2C.2.5D.2.0

下面的类中定义了一个枚举类型,请完成下面的程序。class Base {public:enum Week {Sum, Mon,Tue, Wed, Thu, Fri, Sat};Week a;}void fun(Base B) {【 】 = 【 】; //将对象的a赋值为所定义的枚举类型值为的枚举量}

下列程序的输出结果是_______。class Test{public static void main(String args []){int m=6;do{m--:}while(m>0);System.out.println("m="+m);}}

以下程序的输出结果是 ( ) enum weekday {sun=7,mon=1,tue,wed,thu,fri,sat}; main( ) { enum weekday workday,week_end; int i,a [8]; workday=tue; week end=sun; pritnf("\ntuesday=%d sunday=%d", wotkday, week_end); workday=sun+tue; week_end=(enum weekday)3; printf ("tuesday=%d sunday=%d", workday week_end); a[sun]=sun; a[mon]=mon a[tue]=tue; a[wed]=wed; a[thu]=thu; a[fri]=fr; a[sat]=sat; for(i=1;i<7;i+ +) printf("%d",a [i]); }A.tuesday=2 sunday=7;tuesday=2 sunday=7;1 2 3 4 5 6 7B.tuesday=2 sunday=7;tuesday=9 sunday=3;1 2 3 4 5 6 7C.tuesday=0 sunday=7;tuesday=2 sunday=3;1 2 3 4 5 6 7D.tuesday=1 sunday=2;tuesday=3 sunday=4;1 2 3 4 5 6 7

下列代码的执行结果是public class Test{ public int aMethod(){ static int i=0; i++; System.out.println(i); } public static void main(String args[]){ Test test= new Test(); test. aMethod(); }}A.编译错误B.0C.1D.运行成功,但不输出

阅读下面代码 public class Test { public static void main(String[]args) { System.out.println(2>0?10:8); } } 其运行的结果是A.2B.0C.10D.8

阅读下面代码: public class Test2005 { public static void main(String args[]) { System.out.println((3>2)? 4:5); } } 其运行结果是A.2B.3C.4D.5

下列程序的输出结果是class Test{public static void main(String args[]){int n=7;n 下列程序的输出结果是 class Test{ public static void main(String args[]){ int n=7; n<<=3; n=nn+1|n+2^n+3; n>>=2; System.out.println(n); } }A.0B.-1C.14D.64

阅读下列代码: public class Test2005{ public static void main(String args[]){ System.out.pdntln((3>2)?4:5); } } 其运行结果是( )。A.2B.3C.4D.5

下列代码的执行结果是( )。 public,class Test1 { public static void main(String args[]) { System.out.println(5/2); } }A.2.5B.2.0C.2.50D.2

写出程序的输出结果public abstract class A{public A(){Console.WriteLine('A');}public virtual void Fun(){Console.WriteLine("A.Fun()");}}public class B: A{public B(){Console.WriteLine('B');}public new void Fun(){Console.WriteLine("B.Fun()");}public static void Main(){A a = new B();a.Fun();}}

下列程序的执行结果是( )。 public class Test { public static void main(String args[]) { System.out.println(5/2); } }A.2.5B.2C.2.5D.2

下面的例子中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(){Console.WriteLine("X={0},Y={1}",A.X,B.Y);}}产生的输出结果是什么?

下列代码的执行结果是( )。public class Test{public int aMethod( ){static int i=0;i++;System.out.println(i):}public static void main (String args[]){Trest test=new Test ( );test aMethod( ):}}A.编译错误B.0C.1D.运行成功,但不输出B.C.D.

有以下程序: fun(char p[][10]) { int n=0,i; for(i=0;i<7;i++) if(P[i][0]=='T')n++; return n; } main() {char str[][10]={"Mon","Tue","wed","Thu","Fri","Sat","Sun"}; printf("%d\n",fun(str)); } 程序执行后的输出结果是( )。A.1B.2C.3D.0

以下代码的输出结果?public class Test{int x=5;public static void main(String argv[]){Test t=new Test();t.x++;change(t);System.out.println(t.x);}static void change(Test m){m.x+=2;}} A. 7B. 6C. 5D. 8

阅读以下代码:  public class Test{  public static void main(){  System.out.println(“x=”+x);   } }  请问,代码运行的结果是?() A、 xB、 x=xC、 “x=”+5D、 编译报错

已知enumweek{sun,mon,tue,wed,thu,fri,sat}day;则正确的赋值语句是()A、sun=0;B、san=day;C、sun=mon;D、day=sun;