IT練習資料 1Z0-804 Oracle 資格認定 | adminのブログ

adminのブログ

ブログの説明を入力します。

IT練習資料 1Z0-804 Oracle 資格認定

日本語版の全真模擬試験問題集, IT認定資格 IT試験問題集,IT認証,日語版試験問題集,問題と解答, テスト, 試験の用意をする,備考, 最新の問題集 資格難易度, 受験記対策 練習,練習資料,参考書,日本語版問題集,日本語日本語版練習資料,資格認定,資格, it training, it-shiken.jp ,it 問題と解答 資格難易度, 受験記対策 日本語版の資格試験問題集

1Z0-804 Java SE 7 Programmer II Exam 日本国内における最も信頼できるIT試験専門家として、最新の品質の高いIT試験の学習資料を提供し、お客様のために試験に順調に合格することを助けます.最高品質問題集/試験問題集100パーセント品質保証.問題集は弊社の数名のIT専門家より心をこめて編集して整理されたもので、正確率が99%以上に達します.

IT練習資料 1Z0-804 Oracle 資格認定

QUESTION NO: 1
Given:
import java.io.File;
import java.nio.file.Path;
public class Test12 {
static String displayDetails(String path, int location) {
Path p = new File(path).toPath();
String name = p.getName(location).toString();
return name;
}
public static void main(String[] args) {
String path = "project//doc//index.html";
String result = displayDetails(path,2);
System.out.print(result);
}
}
What is the result?

A. doc
B. index.html
C. an IllegalArgumentException is thrown at runtime.
D. An InvalidPthException is thrown at runtime.
E. Compilation fails.

Answer: B


QUESTION NO: 2
Given the code fragment:
public void otherMethod() {
printFile("");
}
public void printFile(String file) {
try (FileInputStream fis = new FileInputStream(file)) {
System.out.println (fis.read());
} catch (IOException e) {
e.printStackTrace();
}
Why is there no output when otherMethod is called?

A. An exception other than IOException is thrown.
B. Standard error is not mapped to the console.
C. There is a compilation error.
D. The exception is suppressed.

Answer: D

Explanation: The code compiles fine
The line FileInputStream fis = new FileInputStream(file))
will fail at runtime since file is an empty string.
Note:
public void printStackTrace()
Prints this throwable and its backtrace to the standard error stream.


QUESTION NO: 3
Given the code fragment:
public void ReadFile (String source) {
char[] c = new char [128];
int cLen = c.length;
try (FileReader fr = new FileReader (source)) {
int count = 0;
int read = 0;
while ((read = fr.read(c)) != -1) {
count += read;
}
System.out.println("Read: " + count + " characters.");
} catch (IOException i) {
}
What change should you make to this code to read and write strings instead of character arrays?

A. ChangeFileReader to Readers.
B. ChangeFileReader to DataReader.
C. ChangeFileReader to File.
D. ChangeFileReader to BufferReader.

Answer: D

IT練習資料 1Z0-804 Oracle 資格認定