a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 77|回复: 0

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

[复制链接]
发表于 2012-8-3 00:09:22 | 显示全部楼层 |阅读模式
48.public void test(B)) S& `& W0 {) J2 S  g1 X. }
{
! d  {+ x' _6 |; W0 ?% K8 Dint a =100;
* i$ y. I, [# |! V& U9 Zchange (a);
2 k2 Z( A& \- S2 S7 R( E8 I, Jconsole.writeline(a);/ B7 d3 n; Q) B6 ~' ~4 W
} A.0
# G& |- J7 {+ g0 K0 _- w4 jB.1004 F+ U6 m. p1 P, |, _
C.101; B$ n) p; W; _4 P$ U8 N8 ~
49.  class class1{
! z% t; X0 A$ h+ s/ ~. X1 u- ~public virtual void test(){}3 f$ v% @7 W4 L/ S! x% Q) H. ^
}
, O7 R8 [% I& ~7 R/ |class class2:class1{
1 F5 k! C; p/ bpublic override void test(){1 }4 Y  ^$ \2 y& {' M& s$ ?
Console.Write("class2");
% v) F+ q! T! r& E}# S* `) g2 N* l/ y# l8 v
}
% V2 ]6 J# A! Y$ rclass class3:class2{
' L; {' ]2 G- ?public override void test(){4 \( l* V# A+ X0 p. f  J
Console.Write("class3");, k" y/ F* h# z, W6 a
}
# I( \  f, z6 N& T7 ?}4 J* ~6 ?' x# r( x% r: w
则下列语句的输出是什么?(B)(提示:从抽象类派生类的规则)& v, H: I& _" u8 @
class2 x =new class3(); x.test();4 t$ ]9 m9 ?: j" R. g5 Q
A. class3 class2% T7 y( F" b5 ~
B. class3
# `% _+ }& h. t; jC. class2 class3
; K% B* \9 y- n; b' JD. class2
& H4 h! X; m6 s, U5 D( n4 v  l注:class1 x =new class3(); x ,test();结果为:class3
# o" g9 c; |1 ~, y. Uclass1 x =new class2(); x ,test();结果为:class2
0 R4 I# U& T) j2 I, hclass3 x =new class2();编译错误0 l& n2 b( p1 B
50. 接口 imyinterface 的定义如下:
3 N+ {6 A4 a! k" \public interface myinterface{; F$ U* b' k- l1 j
string name {get;set}
, }, h6 n$ o* ^# U1 T, L}
- D4 b7 z' Q. E' e需定义一类 myclass 实现该接口,则下列定义是否合法?()
- E, a: q! `( F  t- L- [7 Sclass myclass :myinterface7 x9 Z2 B* _& m4 ?& A. }
A.合法
8 ~8 Y0 U: H+ W4 XB.不合法
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-15 16:37 , Processed in 0.173344 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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