QUESTION 36
Given the exhibit:
C. System.property ("prop.custom");
D. System.getProperty ("prop.custom"); 根据系统参数来取出对应的参数内容
E. System.getProperties ( ).getProperty ("prop.custom"); 取得所有系统参数的名称,再从中取得“prop.custom”的值
Answer: ( D、E )
A、B不对。用来加载*.dll形式的JNI库(Java Native Interface——JAVA本地调用),不用来获得字符串形式的参数或者变量。
预设的系统属性(JVM变量)包括”os.name”:当前操作系统名称, “java.version”当前Java虚拟机的版本
除预设的系统属性还可用 java –Dkey1=value1 –Dkey2=value2 加入一些临时的系统属性(JVM变量)
D、E是正确的获取系统属性的写法。
参考大纲:Java语言基础
QUESTION 37
Given classes defined in two different files:
What is required at line 5 in class Certkiller App to use the process method of BitUtils?
A. Process (bytes);
B. BitUtils.process (bytes);
C. Util.BitUtils.process (bytes);
D. Certkiller App cannot use methods in BitUtils
E. Import util.BitUtils.*; process (bytes);
Answer: ( C )
参考大纲:Java语言基础
QUESTION 38
Exhibit:
What is the output of the code?
A. Compilation fails.
B. Gobstopper
Fizzylifting
C. Gobstopper
Scremdiddlyumptious
D. Scrumdiddlyumptious
Fizzylifting
E. Scrumiddlyumptious
Scrumdiddlyumptious
Answer: ( B )
参考大纲:Java语言基础 — 存储机制
QUESTION 39
Given classes defined in two different files
What is required at line 5 in class Certkiller Application to use the process method of BitUtils?
A. PROCESS (BYTES);
B. BitUtils.process(bytes);
C. App.BitUtils.process (bytes)
D. Util.BitUtils. process (bytes)
E. Import util.Bitutils.*; process (bytes);
F. Certkiller Application cannot use the process method in BitUtils.
Answer: ( F )
private是私有方法,不能被Certkiller调用
参考大纲:Java语言基础 — 存取修饰符
QUESTION 40
The image represents a complete package structure for a set of classes: "com" is the beginning of the fully-qualified package name for all classes. Give this package structure, insert the code needed to make the Car class compile and run successfully.
All three place holders must be filled. If fewer than three statement are needed, use the "// blank" options.
Answer: ( )
package com.bar;
import com.foo.bar.blatz.*;
import com.foo.bar.* ;
public class Car{
Book book ;
Dog dog ;
}
参考大纲:Java语言基础 — 包