2022年搜狐公司_JAVA高级工程师笔试题及答案 .pdf
《2022年搜狐公司_JAVA高级工程师笔试题及答案 .pdf》由会员分享,可在线阅读,更多相关《2022年搜狐公司_JAVA高级工程师笔试题及答案 .pdf(8页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、1:A class design requires that a member variable should be accessible only by same package, which modifer word should be used? A A.protected B.public C.no modifer D.private 2: What will happen when you attempt to compile and run the following code? B public class Static static int x = 5; static int
2、x,y; public static void main(String args) x-; myMethod(); System.out.println(x + y + +x); public static void myMethod() y = x+ + +x; 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 8 页 - - - - - - - - - Choices: A.prints : 2 B.prints : 3 C.prints : 7 D.prints :
3、8 3: What will be the result of executing the following code? public static void main(String args) char digit = a; for (int i = 0; i 10; i+) switch (digit) case x : int j = 0; System.out.println(j); default : int j = 100; System.out.println(j); int i = j; System.out.println(i); Choices: A.100 will b
4、e printed 11 times. B.The code will not compile because the variable i cannot be declared twice within the main() method. C.The code will not compile because the variable j cannot be declared twice within the switch statement. 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - -
5、 - - 第 2 页,共 8 页 - - - - - - - - - D.None of these. 4:Which fragments are not correct in Java source file? A.package testpackage; public class Test/do something. B.import java.io.*; package testpackage; public class Test/ do something. C.import java.io.*; class Person/ do something. public class Tes
6、t/ do something. D.import java.io.*; import java.awt.*; public class Test/ do something. 5: 下述程序代码中有语法错误的行是() 。int i,ia10,ib10; /* 第一行 */ for (i=0;i=9;i+) /* 第 2 行*/ iai=0; /* 第 3 行*/ ib=ia; /* 第 4 行 */ A.第 1 行B.第 2 行C.第 3 行D.第 4 行6: Which of the following statements are true? A.The automatic garbag
7、e collection of the JVM prevents programs from ever running out of memory B.A program can suggest that garbage collection be performed and force it C.Garbage collection is platform independent D.An object becomes eligible for garbage collection when all references denoting it are set to null. 7: Sel
8、ect valid identifier of Java: A.%passwd B.3d_game C.$charge D.this 8:Math.round(-11.5) 等於多少 ? A.-11 B.-12 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 8 页 - - - - - - - - - C.-11.5 D.none 9: What results from attempting to compile and run the following code?
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年搜狐公司_JAVA高级工程师笔试题及答案 2022 搜狐 公司 _JAVA 高级工程师 笔试 答案
限制150内