Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-852
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-852.html
Java Standard Edition 6 Programmer Certified Professional Upgrade Exam
Question No: 11
Given:
-
class Alligator {
-
public static void main(String[] args) { 3. int []x[] = {{1,2}, {3,4,5}, {6,7,8,9}};
4. int [][]y = x;
-
System.out.println(y[2][1]); 6. }
7. }
What is the result?
-
2
-
3
-
4
-
6
-
7
-
Compilation fails.
-
Answer: E
Question No: 12
Given:
-
public static void main(String[] args) {
-
Object obj = new int[] { 1, 2, 3 };
-
int[] someArray = (int[])obj;
-
for (int i : someArray) System.out.print(i quot; quot;);
15. }
What is the result?
A. 1 2 3
-
Compilation fails because of an error in line 12.
-
Compilation fails because of an error in line 13.
-
Compilation fails because of an error in line 14.
-
A ClassCastException is thrown at runtime.
Answer: A
Question No: 13
Given:
11. public interface A { public void m1(); } 12.
-
class B implements A { }
-
class C implements A { public void m1() { } }
-
class D implements A { public void m1(int x) { } }
-
abstract class E implements A { }
-
abstract class F implements A { public void m1() { } }
-
abstract class G implements A { public void m1(int x) { } } What is the result?
-
Compilation succeeds.
-
Exactly one class does NOT compile.
-
Exactly two classes do NOT compile.
-
Exactly four classes do NOT compile.
-
Exactly three classes do NOT compile.
Answer: C
Question No: 14
Given:
-
abstract class C1 {
-
public C1() { System.out.print(1); }
23. }
-
class C2 extends C1 {
-
public C2() { System.out.print(2); }
26. }
-
class C3 extends C2 {
-
public C3() { System.out.println(3); }
29. }
-
public class Ctest {
-
public static void main(String[] a) { new C3(); }
32. }
What is the result?
-
3
-
23
-
32 D. 123 E. 321
-
Compilation fails.
-
An exception is thrown at runtime.
Answer: D
Question No: 15
Given:
-
public class A {
-
public void doit() { 3. }
-
-
public String doit() {
-
return quot;aquot;; 6. }
-
public double doit(int x) {
-
return 1.0; 9. }
10. }
What is the result?
-
An exception is thrown at runtime.
-
Compilation fails because of an error in line 7.
-
Compilation fails because of an error in line 4.
-
Compilation succeeds and no runtime errors with class A occur.
Answer: C
Question No: 16
Given:
-
public class Plant {
-
private String name;
-
public Plant(String name) { this.name = name; }
-
public String getName() { return name; } 5. }
-
-
-
public class Tree extends Plant {
-
public void growFruit() { }
-
public void dropLeaves() { } 4. }
Which statement is true?
-
The code will compile without changes.
-
The code will compile if public Tree() { Plant(); } is added to the Tree class.
-
The code will compile if public Plant() { Tree(); } is added to the Plant class.
-
The code will compile if public Plant() { this(quot;fernquot;); } is added to the Plant class.
-
The code will compile if public Plant() { Plant(quot;fernquot;); } is added to the Plant class.
-
Answer: D
Question No: 17
Given:
-
String test = quot;Test A. Test B. Test C.quot;;
-
// insert code here
-
String[] result = test.split(regex);
Which regular expression, inserted at line 12, correctly splits test into quot;Test Aquot;, quot;Test Bquot;, and quot;Test Cquot;?
-
String regex = quot;quot;;
-
String regex = quot; quot;;
-
String regex = quot;.*quot;;
-
String regex = quot;\\squot;;
-
String regex = quot;\\.\\s*quot;;
-
String regex = quot;\\w[ \.] quot;;
Answer: E
Question No: 18
Given that the current directory is empty, and that the user has read and write privileges to the current directory, and the following:
-
import java.io.*;
-
public class Maker {
-
public static void main(String[] args) {
-
File dir = new File(quot;dirquot;);
-
File f = new File(dir, quot;fquot;); 6. }
7. }
Which statement is true?
-
Compilation fails.
-
Nothing is added to the file system.
-
Only a new file is created on the file system.
-
Only a new directory is created on the file system.
-
Both a new file and a new directory are created on the file system.
-
-
Answer: B
Question No: 19
Given:
22. StringBuilder sb1 = new StringBuilder(quot;123quot;);
23. String s1 = quot;123quot;;
-
// insert code here
-
System.out.println(sb1 quot; quot; s1);
Which code fragment, inserted at line 24, outputs quot;123abc 123abcquot;?
-
sb1.append(quot;abcquot;); s1.append(quot;abcquot;);
-
sb1.append(quot;abcquot;); s1.concat(quot;abcquot;);
-
sb1.concat(quot;abcquot;); s1.append(quot;abcquot;);
-
sb1.concat(quot;abcquot;); s1.concat(quot;abcquot;);
-
sb1.append(quot;abcquot;); s1 = s1.concat(quot;abcquot;);
-
sb1.concat(quot;abcquot;); s1 = s1.concat(quot;abcquot;);
-
sb1.append(quot;abcquot;); s1 = s1 s1.concat(quot;abcquot;);
-
sb1.concat(quot;abcquot;); s1 = s1 s1.concat(quot;abcquot;);
Answer: E
Question No: 20
Given:
-
import java.util.Date;
-
import java.text.DateFormat;
-
DateFormat df
-
Date date = new Date();
-
// insert code here
-
String s = df.format(date);
Which code fragment, inserted at line 23, allows the code to compile?
-
df = new DateFormat();
-
df = Date.getFormat();
-
df = date.getFormat();
-
df = DateFormat.getFormat();
-
df = DateFormat.getInstance();
Answer: E
100% Ensurepass Free Download!
–Download Free Demo:1z0-852 Demo PDF
100% Ensurepass Free Guaranteed!
–1z0-852 Dumps
EnsurePass | ExamCollection | Testking | |
---|---|---|---|
Lowest Price Guarantee | Yes | No | No |
Up-to-Dated | Yes | No | No |
Real Questions | Yes | No | No |
Explanation | Yes | No | No |
PDF VCE | Yes | No | No |
Free VCE Simulator | Yes | No | No |
Instant Download | Yes | No | No |
100-105 Dumps VCE PDF
200-105 Dumps VCE PDF
300-101 Dumps VCE PDF
300-115 Dumps VCE PDF
300-135 Dumps VCE PDF
300-320 Dumps VCE PDF
400-101 Dumps VCE PDF
640-911 Dumps VCE PDF
640-916 Dumps VCE PDF
70-410 Dumps VCE PDF
70-411 Dumps VCE PDF
70-412 Dumps VCE PDF
70-413 Dumps VCE PDF
70-414 Dumps VCE PDF
70-417 Dumps VCE PDF
70-461 Dumps VCE PDF
70-462 Dumps VCE PDF
70-463 Dumps VCE PDF
70-464 Dumps VCE PDF
70-465 Dumps VCE PDF
70-480 Dumps VCE PDF
70-483 Dumps VCE PDF
70-486 Dumps VCE PDF
70-487 Dumps VCE PDF
220-901 Dumps VCE PDF
220-902 Dumps VCE PDF
N10-006 Dumps VCE PDF
SY0-401 Dumps VCE PDF