IT認証試験問題集
毎月、ITshikenは1500人以上の受験者が試験準備を助けて、試験に合格するために受験者にご協力します
 ホームページ / 1Z0-804 問題集  / 1Z0-804 問題練習

Oracle 1Z0-804 問題練習

Java SE 7 Programmer II Exam 試験

最新更新時間: 2019/05/15,合計131問。

平成から令和へ:1Z0-804 最新真題を買う時、日本語版と英語版両方を同時に獲得できます。

実際の問題集を練習し、試験のポイントを了解し、テストに申し込むするかどうかを決めることができます。

さらに試験準備時間の35%を節約するには、1Z0-804 問題集を使用してください。

 / 9

Question No : 1
Which four are true about enums?

正解:

Question No : 2
Given:
StringBuffer b = new StringBuffer("3");
System.out.print(5+4+b+2+1);
What is the result?

正解:

Question No : 3
An application is waiting for notification of changes to a tmp directory using the following code
statements:
Path dir = Paths.get("tmp")
WatchKey key = dir.register (watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY) ;
In the tmp directory, the user renames the file testA to testB,
Which statement is true?

正解:

Question No : 4
Given the code fragment:
public class Base {
BufferedReader br;
String record;
public void process() throws FileNotFoundException {
br = new BufferedReader(new FileReader("manual.txt"));
}
}
public class Derived extends Base {
// insert code here. Line ***
public static void main(String[] args) {
try {
new Derived().process();
} catch (Exception e) { }
}
}
Which code fragment inserted at line ***, enables the code to compile?

正解:

Question No : 5
Given the cache class:
public class Cache {
private T t;
public void setValue (T t) { this.t=t; }
public T getValue() {return t; }
}
What is the result of the following?
Cache<> c = new Cache<Integer>(); // Line 1
c.SetValue(100); // Line 2
System.out.print(c.getValue().intValue() +1); // Line 3

正解:

Question No : 6
Given:
public class Print01 {
public static void main(String[] args) {
double price = 24.99;
int quantity = 2;
String color = "Blue";
// insert code here. Line ***
}
}
Which two statements, inserted independently at line ***, enable the program to produce the
following output:
We have 002 Blue pants that cost $24.99.

正解:
Explanation:

Question No : 7
Given that myFile.txt contains:
First
Second
Third
And given:
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class ReadFile04 {
public static void main(String[] args) {
try (BufferedReader buffIn =
new BufferedReader(new FileReader("D:\\faculty\\myfile.txt"))) {
String line = "";
int count = 1;
buffIn.mark(1);
line = buffIn.readLine();
System.out.println(count + ": " + line);
line = buffIn.readLine();
count++;
System.out.println(count + ": " + line);
buffIn.reset();
line = buffIn.readLine();
count++;
System.out.println(count + ": " + line);
} catch (IOException e) {
System.out.println("IOException");
}
}
}
What is the result?

正解:

Question No : 8
Given the database table:



And given this class:



Assume that the SQL integer queries are valid. What is the result of compiling and executing this
code fragment?
Refer to the exhibit.



正解:

Question No : 9
Given the following incorrect program:



Which two changes make the program work correctly?

正解:

Question No : 10
Given the code fragment:
public class IsContentSame {
public static boolean isContentSame() throws IOException {
Path p1=Paths.get("D:\\faculty\\report.txt");
Path p2=Paths.get("C:\\student\\report.txt");
Files.copy(p1,p2,StandardCopyOption.REPLACE_EXISTING,StandardCopyOption.COPY_ATTRI
BUTES,LinkOption.NOFOLLOW_LINKS);
if(Files.isSameFile(p1,p2)) {
return true;
} else {
return false;
}
}
public static void main(String[] args) {
try {
boolean flag = isContentSame();
if(flag)
System.out.println("Equal");
else
System.out.println("Not equal");
} catch (IOException e) {
System.err.println("Caught IOException: " + e.getMessage());
}
}
}
What is the result when the result.txt file already exists in c:\student?

正解:

Question No : 11
Given:



From what threading problem does the program suffer?

正解:

Question No : 12
Given:
public class Runner {
public static String name = "unknown";
public void start() {
System.out.println(name);
}
public static void main(String[] args) {
name = "Daniel";
start();
}
}
What is the result?

正解:

Question No : 13
Given:
import java.util.concurrent.atomic.AtomicInteger;
public class AtomicCounter {
private AtomicInteger c = new AtomicInteger(0);
public void increment() {
// insert code here
}
}
Which line of code, inserted inside the increment () method, will increment the value of c?

正解:

Question No : 14
Given the code fragment:
String s = "Java 7, Java 6";
Pattern p = Pattern.compile("Java.+\\d");
Matcher m = p.matcher(s);
while (m.find()) {
System.out.println(m.group());
}
What is the result?

正解:

Question No : 15
Given:
public class Counter {
public static int getCount(String[] arr) {
int count =0 ;
for(String var:arr) {
if(var!=null) count++;
}
return count;
}
public static void main(String[] args) {
String[] arr =new String[4];
arr[1] = "C";
arr[2] = "";
arr[3] = "Java";
assert (getCount(arr) < arr.length);
System.out.print(getCount(arr));
}
}
And the commands:
javac Counter.java
java Cea Counter
What is the result?

正解:

 / 9