Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-853
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-853.html
Java Standard Edition 5 Programmer Certified Professional Exam
Question No: 141 – (Topic 2)
Given:
-
class ClassA {
-
public int numberOfInstances;
-
protected ClassA(int numberOfInstances) {
-
this.numberOfInstances = numberOfInstances; 5. }
6. }
-
public class ExtendedA extends ClassA {
-
private ExtendedA(int numberOfInstances) {
-
super(numberOfInstances);
10. }
-
public static void main(String[] args) {
-
ExtendedA ext = new ExtendedA(420);
-
System.out.print(ext.numberOfInstances);
14. }
15. }
Which statement is true?
-
An exception is thrown at runtime.
-
All constructors must be declared public.
-
Constructors CANNOT use the private modifier.
-
420 is the output.
-
Constructors CANNOT use the protected modifier.
Answer: D
Question No: 142 – (Topic 2)
Click the Exhibit button.
What two must the programmer do to correct the compilation errors? (Choose two.)
-
insert a call to super(vin) in the MeGo constructor
-
insert a call to this() in the MeGo constructor
-
insert a call to this() in the Car constructor
-
change line 3 in the MeGo class to super.wheelCount = 3;
-
change the wheelCount variable in Car to protected
-
insert a call to super() in the MeGo constructor
Answer: A,E
Question No: 143 – (Topic 2)
Given:
20. public class CreditCard { 21.
-
private String cardID;
-
private Integer limit;
-
public String ownerName; 25.
-
public void setCardInformation(String cardID,
-
String ownerName,
-
Integer limit) {
-
this.cardID = cardID;
-
this.ownerName = ownerName;
-
this.limit = limit;
32. }
33. }
Which statement is true?
-
The ownerName variable breaks encapsulation.
-
The cardID and limit variables break polymorphism.
-
The class is fully encapsulated.
-
The setCardInformation method breaks encapsulation.
-
The code demonstrates polymorphism.
Answer: A
Question No: 144 – (Topic 2)
Click the Exhibit button.
What is the output if the main() method is run?
-
5
-
8
-
An exception is thrown at runtime.
-
It is impossible to determine for certain.
-
9
-
4
-
Compilation fails.
Answer: E
Question No: 145 DRAG DROP – (Topic 2)
Click the Task button.
Answer:
Question No: 146 – (Topic 2)
Click the Exhibit button. Given:
-
Test t = new Test();
-
t.method(5);
What is the output from line 5 of the Test class?
-
17
-
10
-
12
-
5
-
24
Answer: B
Question No: 147 – (Topic 2)
Given:
-
interface A { void x(); }
-
class B implements A { public void x() {} public void y() {} }
-
class C extends B { public void x() {} } And:
-
java.util.Listlt;Agt; list = new java.util.ArrayListlt;Agt;();
-
list.add(new B());
-
list.add(new C());
-
for (A a : list) { 24. a.x();
25. a.y();
26. }
What is the result?
-
An exception is thrown at runtime.
-
The code runs with no output.
-
Compilation fails because of an error in line 25.
-
Compilation fails because of an error in line 20.
-
Compilation fails because of an error in line 21.
-
Compilation fails because of an error in line 23.
Answer: C
Question No: 148 DRAG DROP – (Topic 2)
Click the Task button.
Answer:
Question No: 149 – (Topic 2)
Given:
-
public class Target {
-
private int i = 0;
-
public int addOne(){
-
return i; 5. }
-
6. }
And:
-
public class Client {
-
public static void main(String[] args){
-
System.out.println(new Target().addOne()); 4. }
5. }
Which change can you make to Target without affecting Client?
-
Line 3 of class Target can be changed to private int addOne(){
-
Line 2 of class Target can be changed to private Integer i = 0;
-
Line 4 of class Target can be changed to return i ;
-
Line 2 of class Target can be changed to private int i = 1;
-
Answer: B
Question No: 150 – (Topic 2)
Given:
-
abstract public class Employee {
-
protected abstract double getSalesAmount();
-
public double getCommision() {
-
return getSalesAmount() * 0.15;
14. }
15. }
-
class Sales extends Employee {
-
// insert method here
18. }
Which two methods, inserted independently at line 17, correctly complete the Sales class? (Choose two.)
-
private double getSalesAmount() { return 1230.45; }
-
protected double getSalesAmount() { return 1230.45; }
-
public double getSalesAmount() { return 1230.45; }
-
double getSalesAmount() { return 1230.45; }
Answer: B,C
100% Ensurepass Free Download!
–Download Free Demo:1z0-853 Demo PDF
100% Ensurepass Free Guaranteed!
–1z0-853 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