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: 1
Given:
-
public class Base {
-
public static final String FOO = quot;fooquot;;
-
public static void main(String[] args) {
-
Base b = new Base();
-
Sub s = new Sub();
-
System.out.print(Base.FOO);
-
System.out.print(Sub.FOO);
-
System.out.print(b.FOO);
-
System.out.print(s.FOO);
-
System.out.print(((Base)s).FOO); 11. } }
12. class Sub extends Base {public static final String FOO=quot;barquot;;} What is the result?
-
foofoofoofoofoo
-
foobarfoobarbar
-
foobarfoofoofoo
-
foobarfoobarfoo
-
barbarbarbarbar
-
foofoofoobarbar
-
foofoofoobarfoo
Answer: D
Question No: 2
A company has a business application that provides its users with many different reports:
receivables reports, payables reports, revenue projects, and so on. The company has just purchased some new, state-of-the-art, wireless printers, and a programmer has been assigned the task of enhancing all of the reports to use not only the company#39;s old printers, but the new wireless printers as well. When the programmer starts looking into the application, the programmer discovers that because of the design of the application, it is necessary to make changes to eachreport to support the new printers. Which two design concepts most likely explain this situation? (Choose two.)
-
Inheritance
-
Low cohesion
-
Tight coupling
-
High cohesion
-
Loose coupling
-
Object immutability
Answer: B,C
Question No: 3
Given:
-
class Building { }
-
public class Barn extends Building {
-
public static void main(String[] args) {
-
Building build1 = new Building();
-
Barn barn1 = new Barn();
-
Barn barn2 = (Barn) build1;
-
Object obj1 = (Object) build1;
-
String str1 = (String) build1;
-
Building build2 = (Building) barn1;
14. }
15. }
Which is true?
-
If line 10 is removed, the compilation succeeds.
-
If line 11 is removed, the compilation succeeds.
-
If line 12 is removed, the compilation succeeds.
-
If line 13 is removed, the compilation succeeds.
-
More than one line must be removed for compilation to succeed.
Answer: C
Question No: 4
Given:
-
abstract class A {
-
abstract void a1();
-
void a2() { }
13. }
-
class B extends A {
-
void a1() { }
-
void a2() { }
17. }
18. class C extends B { void c1() { } } and:
A x = new B(); C y = new C(); A z = new C();
What are four valid examples of polymorphic method calls? (Choose four.)
A. x.a2();
B. z.a2();
C. z.c1();
D. z.a1();
E. y.c1();
F. x.a1();
Answer: A,B,D,F
Question No: 5
A company that makes Computer Assisted Design (CAD) software has, within its application, some utility classes that are used to perform 3D rendering tasks. The company#39;s chief scientist has just improved the performance of one of the utility classes#39; key rendering algorithms, and has assigned a programmer to replace the old algorithm with the new algorithm. When the programmer begins researching the utility classes, she is happy to discover that the algorithm to be replaced exists in only one class. The programmer reviews that class#39;s API, and replaces the old algorithm with the new algorithm, being careful that her changes adhere strictly to the class#39;s API. Once testing has begun, the programmer discovers that other classes that use the class she changed are no longer working properly. What design flaw is most likely the cause of these new bugs?
-
Inheritance
-
Tight coupling
-
Low cohesion
-
High cohesion
-
Loose coupling
-
Object immutability
Answer: B
Question No: 6
Given:
11. class Mammal { } 12.
-
class Raccoon extends Mammal {
-
Mammal m = new Mammal();
15. } 16.
17. class BabyRaccoon extends Mammal { } Which four statements are true? (Choose four.)
-
Raccoon is-a Mammal.
-
Raccoon has-a Mammal.
-
BabyRaccoon is-a Mammal.
-
BabyRaccoon is-a Raccoon.
-
BabyRaccoon has-a Mammal.
-
BabyRaccoon is-a BabyRaccoon.
Answer: A,B,C,F
Question No: 7
Given:
-
public class Hi {
-
void m1() { }
-
protected void() m2 { }
-
} 6. class Lois extends Hi {
-
// insert code here 8. }
Which four code fragments, inserted independently at line 7, will compile? (Choose four.)
-
public void m1() { }
-
protected void m1() { }
-
private void m1() { }
-
void m2() { }
-
public void m2() { }
-
protected void m2() { }
-
private void m2() { }
-
Answer: A,B,E,F
Question No: 8
Given that:
Gadget has-a Sprocket and Gadget has-a Spring and Gadget is-a Widget and Widget has-a Sprocket
Which two code fragments represent these relationships? (Choose two.)
-
class Widget { Sprocket s; }
class Gadget extends Widget { Spring s; }
-
class Widget { }
class Gadget extends Widget { Spring s1; Sprocket s2; }
-
class Widget { Sprocket s1; Spring s2; } class Gadget extends Widget { }
-
class Gadget { Spring s; }
class Widget extends Gadget{ Sprocket s; }
-
class Gadget { }
class Widget extends Gadget{ Sprocket s1; Spring s2; }
-
class Gadget { Spring s1; Sprocket s2; } class Widget extends Gadget{ }
Answer: A,C
Question No: 9
Given the following six method names:
addListener addMouseListener setMouseListener deleteMouseListener removeMouseListener registerMouseListener
How many of these method names follow JavaBean Listener naming rules?
-
1
-
2
-
3
-
4
-
5
Answer: B
Question No: 10
Click the Exhibit button.
Which three statements are true? (Choose three.)
-
Compilation fails.
-
The code compiles and the output is 2.
-
If lines 16, 17 and 18 were removed, compilation would fail.
-
If lines 24, 25 and 26 were removed, compilation would fail.
-
If lines 16, 17 and 18 were removed, the code would compile and the output would be 2.
-
If lines 24, 25 and 26 were removed, the code would compile and the output would be 1.
Answer: B,E,F
100% Ensurepass Free Download!
–Download Free Demo:1z0-852 Demo PDF
100% Ensurepass Free Guaranteed!
–1z0-852 DumpsEnsurePass 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 HOT CATEGORY!HOT EXAM!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