a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 78|回复: 0

[考试试题] 微软认证考试模拟题2(17)

[复制链接]
发表于 2012-8-3 00:09:22 | 显示全部楼层 |阅读模式
48.public void test(B)
( q1 @0 E* o& P, V{2 Y% D6 I; N/ @# H2 c
int a =100;/ L& ?4 }% ?5 C( s9 i
change (a);
  w' K# {- e1 a4 Q7 O- e- Wconsole.writeline(a);0 S# Y. [7 o1 X3 `1 P4 \
} A.0
7 Z$ h3 W, H( OB.100- v% G. W; }1 u
C.1012 v4 H/ e* x5 t' M9 p) k
49.  class class1{
* s% C) `( o/ m* h1 H# r. @8 Y/ a4 cpublic virtual void test(){}
7 q& `5 Y+ ]% _, l" w, Y1 y% m}. G/ b. ~' F& f, h
class class2:class1{
/ j  R# \& w+ B9 c- Y% bpublic override void test(){
0 @- x* a/ i% fConsole.Write("class2");
( ?+ V2 e6 b# [  U$ _# A}
8 a/ t9 a1 `2 c9 t. i) q3 ^}
- x  q9 {9 E/ z& C  O- v0 D! @class class3:class2{
* s% s% a6 `8 j7 D/ D. ~5 s$ cpublic override void test(){
0 L) h" E$ |7 Z2 m. dConsole.Write("class3");4 q; v* B9 U. y- Z
}$ A7 Q" d% U' }! q0 t* D) j. P
}: S4 Z# Y/ B* v) Z
则下列语句的输出是什么?(B)(提示:从抽象类派生类的规则)
; L! S/ K5 Z* Fclass2 x =new class3(); x.test();. K$ ?. J, a3 @; _
A. class3 class2
4 S3 T. e% z: M- GB. class3( c( b7 u5 w1 h5 n" Q
C. class2 class32 g4 q- ]/ ^$ P9 H4 A2 y8 e4 p
D. class2
! K, [8 {. e* Y/ P8 K' ^& Z注:class1 x =new class3(); x ,test();结果为:class3 / T$ k# l1 w, O* E# L& ~. V
class1 x =new class2(); x ,test();结果为:class2  n3 E) G' g  I
class3 x =new class2();编译错误
$ Z8 i% @# u6 {: Y" n+ F& k, q50. 接口 imyinterface 的定义如下:7 w  Y2 J, G1 S
public interface myinterface{  H" I" R$ W& {5 l# j
string name {get;set}
/ H7 D' Q7 {. C. H}1 B& P' F/ s( ^, Z: [$ l
需定义一类 myclass 实现该接口,则下列定义是否合法?()# ]# x; s1 h4 z5 j
class myclass :myinterface+ Y$ r) b6 c8 r/ G( J: k
A.合法
+ A  }+ _6 b# V) A6 QB.不合法
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-18 21:42 , Processed in 0.202822 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表