下载后可任意编辑姓名: 联系电话: 电子邮件: 学历: 专业: 毕业时间: 中山大学软件工程师试题 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命运如同手中的掌纹,无论多曲折,终掌握在自己手中==============================================================下载后可任意编辑 E、line 15 4、哪些是将一个十六进制值赋值给一个 long 型变量?[ D ]A. long number = 345L;B. long number = 0345;C. long number = 0345L;D. long number = 0x345L 5、下面的哪些叙述为真? [ D ]A. equals()方法判定引用值是否指向同一对象。B. == 操作符判定两个分立的对象的内容和类型是否一致。C. equals()方法只有在两个对象的内容一致时返回 true。D. 类 File 重写方法 equals()在两个分立的对象的内容和类型一致时返回 true。6、 给出下面的代码片断:1) class Person {2} public void printValue(int i, int j) {/*…*/ }3} public void printValue(int i){/*...*/ }4} }5) public class Teacher extends Person {6} public void printValue() {/*...*/ }7} public void printValue(int i) {/*...*/}8} public static void main(String args[]){9} Person t = new Teacher();10} t.printValue(10);11} }12} } 第十行的声明将调用哪些方法? ...