a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 101|回复: 0

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

[复制链接]
发表于 2012-8-3 00:09:22 | 显示全部楼层 |阅读模式
57.分析下列类的定义:& L& s/ @5 ~; q: ^3 I6 Z8 z6 t
public class base1{3 F1 g3 G8 a- q9 l( ]( _1 g
protected base1(){Console.Write("base!");}3 ]# I" P) ^# D0 l5 t3 l7 x! t3 {
}9 L: e" S! K- s# `, j
public class myclass{
3 O* x- p6 Y/ A% ^public myclass(){Console.Write("myclass!");}9 l; @5 X3 ^# L# n- S
}
" z  H" W- x! ~/ F' R6 g3 B若合法,则在 main 中执行下列诗句 myclass h=new myclass();后,控制台的输出是什么?(C) A 不合法' I5 I' {$ k! E! t
B myclass!, ^8 V$ h$ Z3 a% S8 E+ }
C base!myclass!
. {: q1 g( {! l" x8 Y' I- a3 x9 OD myclass!base!/ C1 n6 L- b% B( V4 K
注:protected 改为 private 则不合法. F5 U) U1 _" \! @
59.在 c#程序中,入口函数的正确声明为:( B).
  m" y/ _4 ^# a3 r5 X5 B9 b' gA. static int main(){……}
2 }5 v9 p, \  U1 x. |8 j' eB. static void Main(){……}
4 R7 g/ X3 w. s& HC. static void main(){……}& G+ ~; |; S- P! }7 T, ]
D. void Main(){……}
/ y, Z3 X) a  T' y/ O9 S7 L; m60.现在需要编写代码在 ShowInformation 中将 MyClass 当前对象的 data 域赋值为 100.正确的语句为:( D).
2 A; y- k7 }) o& K5 |4 ~) AA. data=100;
0 q# r% _8 i1 k6 a& J* S- \1 pB. self.data=100;
) D! ]* k( {8 I) o# b% lC. me.data=100;
, A. _3 F- U! b- c2 n& T# S& I8 \D. this.data=100;
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-15 08:24 , Processed in 0.151457 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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