下载后可任意编辑姓名: 联系电话: 电子邮件: 学历: 专业: 毕业时间: 中山大学软件工程师试题 C(满分 100 分,作答时间为 120 分钟)一、单项选择题(每题 2 分,共 40 分)1、给出如下代码:class Test{ private int m; public static void fun() { // some code
}}如何使成员变量 m 被函数 fun()直接访问
[ C ] A、将 private int m 改为 protected int m B、将 private int m 改为 public int m C、将 private int m 改为 static int m D、将 private int m 改为 int m2、Java 中 main()函数的返回值是什么
[ D ] A、 String B、int C、char D、void3、已知如下代码:1: class Example{2: String str;3: public Example(){4: str= "example";5: }6: public Example(String s){7: str=s;8: }9:}10: class Demo extends Example{11: }12: public class Test{13: public void f () {14:Example ex = new Example("Good");15:Demo d = new Demo("Good");16: } }哪句语句会导致错误
[ E ] A、 line 3 B、line 6 C、line 10 D、line 14命运如同手中的掌纹,无论多曲折,终掌握在自己手中==============================================