当前位置:首页 > 全部子站 > IT > 思科认证

JAVA模拟题:TestoftheJavaSkill(4)

来源:长理培训发布时间:2017-12-19 10:40:10

 百度广告

  Question 25: 

   int Output = 10; 
if ((b1==true)&&((Output+=10)==20)){ 

System.out.println("Not equal!" + Output); 

   A. Compile error, attempting to perform binary comparison on logical data type

   B. Compilation and output of "We are equal 10"

   C. Compilation and output of "Not equal! 20"

   D. Compilation and output of "Not equal! 10"

   Question 26: 

   A. Java uses a time-slicing scheduling system for determining which Thread will execute.

   B. Java uses a pre-emptive, co-operative system for determining which Thread will execute.

   C. Java scheduling is platform dependent and may vary from one implementation to another.

   D. You can set the priority of a Thread in code. 
What will happen when you attempt to compile and run the following code?

   public class MySwitch{ 
MySwitch ms = new MySwitch(); 

int k=10; 
default: 
break; 
System.out.println("ten"); 
System.out.println("twenty"); 

}

   A. None of these options

   B. Compile time error target of switch must be an integral type

   C. Compile and run with output "This is the default output"

   D. Compile and run with output "ten" |||

   Question 28: 
public class StrEq{ 
StrEq s = new StrEq(); 
private StrEq(){ 
String s2 = new String("Marcus"); 
System.out.println("we have a match"); 
System.out.println("Not equal"); 

   A. Compile time error caused by private constructor

   B. Output of "we have a match"

   C. Output of "Not equal"

   D. Compile time error by attempting to compare string using ==

   Question 29: 

   A. short myshort = 99S;

   B. String name = 'Excellent tutorial Mr Green';

   C. char c = 17c;

   D. int z = 015; 
Which of the following are benefits of encapsulation?

   A. All variables can be manipulated as Objects instead of primitives

   B. By making all variables protected they are protected from accidental corruption

   C. The implementation of a class can be changed without breaking code that uses it

   D. making all methods protected prevents accidental corruption of data

   Question 31: 

   interface IFace{} 
class Base{}

   public class ObRef extends Base{ 
ObRef ob = new ObRef(); 
Object o1 = new Object(); 

   A. o1 = o2;

   B. b = ob;

   C. ob = b;

   D. o1 = b; 
Your chief software designer has shown you a sketch of the new Computer parts system she is about to create. At the top of the hierarchy is a Class called Computer and under this are two child classes. One is called LinuxPC and one is called WindowsPC. The main difference between the two is that one runs the Linux OS and the other runs the Windows OS (of course another difference is that one needs constant re-booting and the other runs reliably). Under the WindowsPC are two Sub classes one called Server and one Called Workstation. How might you appraise your designers work?

   A. Give the go ahead for further design using the current scheme

   B. Ask for a re-design of the hierarchy with changing the OS to a field rather than Class type

   C. Ask for the option of WindowsPC to be removed as it will soon be obsolete 

责编:罗莉

发表评论(共0条评论)
请自觉遵守互联网相关政策法规,评论内容只代表网友观点,发表审核后显示!

国家电网校园招聘考试直播课程通关班

  • 讲师:刘萍萍 / 谢楠
  • 课时:160h
  • 价格 4580

特色双名师解密新课程高频考点,送国家电网教材讲义,助力一次通关

配套通关班送国网在线题库一套

课程专业名称
讲师
课时
查看课程

国家电网招聘考试录播视频课程

  • 讲师:崔莹莹 / 刘萍萍
  • 课时:180h
  • 价格 3580

特色解密新课程高频考点,免费学习,助力一次通关

配套全套国网视频课程免费学习

课程专业名称
讲师
课时
查看课程
在线题库
面授课程更多>>
图书商城更多>>
在线报名
  • 报考专业:
    *(必填)
  • 姓名:
    *(必填)
  • 手机号码:
    *(必填)
返回顶部