Consider following interface. Which of the following will create instance of Runnable type?
Correct Answer: A
Option A is the correct answer. To create we have used following method with LocalDate class; public static LocalDate of(intyear, int month, intdayOfMonth) Here we need to remember that month is not zero based so if you pass 1 for month, then month will be January. Then we have used period object of 1 day and add to date object which makes current date to next day, so final output is 2015-03-27. Hence option A is correct.
1z0-808 Exam Question 162
Given: What is the result?
Correct Answer: C
1z0-808 Exam Question 163
Which of the following can fill in the blank in this code to make it compile? (Select 2 options.)
Correct Answer: A,C
Option A and C are the correct answer. In a method declaration, the keyword throws is used. So here at line 1 we have to use option A. To actually throw an exception, the keyword throw is used and a new exception is created, so at line 2 we have to use throw and new keywords, which is option C. Finally it will look like; public void method() throws Exception { throw new Exception0; } REFERENCE : httpsy/docs.oracle.com/javase/tutorial/essential/io/fileOps.html#exception The correct answer is: On line 1, fill in throws. On line 2, fill in throw new
1z0-808 Exam Question 164
Given the fragment: What is the result?
Correct Answer: F
The two elements 3 and 4 (starting from position with index 2) are copied into position index 1 and 2 in the same array. After the arraycopy command the array looks like: {1, 3, 4, 4, 5}; Then element with index 1 is printed: 3 Then element with index 4 is printed: 5 Note: The System class has an arraycopy method that you can use to efficiently copy data from one array into another: public static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length) The two Object arguments specify the array to copy from and the array to copy to. The three int arguments specify the starting position in the source array, the starting position in the destination array, and the number of array elements to copy.