[Free] 2018(Jan) EnsurePass Testinsides Oracle 1z0-853 Dumps with VCE and PDF 181-190

By | January 25, 2018

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: 181 – (Topic 2)

Given:

  1. package com.company.application; 2.

  1. public class MainClass {

  2. public static void main(String[] args) {} 5. }

    And MainClass exists in the /apps/com/company/application directory. Assume the CLASSPATH environment variable is set to quot;.quot; (current directory).

    Which two java commands entered at the command line will run MainClass? (Choose two.)

    1. java -classpath /apps/com/company/application:. MainClass if run from the /apps directory

    2. java -classpath . MainClass if run from the /apps/com/company/application directory

    3. java -classpath /apps com.company.application.MainClass if run from any directory

    4. java MainClass if run from the /apps directory

    5. java com.company.application.MainClass if run from the /apps directory

    6. java com.company.application.MainClass if run from the /apps/com/company/application directory

      Answer: C,E

      Question No: 182 – (Topic 2)

      Given:

      1. public class Target {

      2. private int i = 0;

      3. public int addOne(){

      4. return i; 5. }

6. }

And:

  1. public class Client {

  2. public static void main(String[] args){

  3. System.out.println(new Target().addOne()); 4. }

    5. }

    Which change can you make to Target without affecting Client?

    1. Line 3 of class Target can be changed to private int addOne(){

    2. Line 2 of class Target can be changed to private Integer i = 0;

    3. Line 4 of class Target can be changed to return i ;

    4. Line 2 of class Target can be changed to private int i = 1;

Answer: B

Question No: 183 – (Topic 2)

Given:

  1. public void genNumbers() {

  2. ArrayList numbers = new ArrayList(); 13. for (int i=0; ilt;10; i ) {

  1. int value = i * ((int) Math.random());

  2. Integer intObj = new Integer(value);

  3. numbers.add(intObj);

17. }

18. System.out.println(numbers);

19. }

Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbage collection?

  1. The object is NOT a candidate for garbage collection.

  2. Line 18

  3. Line 19

  4. Line 16

  5. Line 17

Answer: C

Question No: 184 – (Topic 2)

Click the Exhibit button. What is the result?

Ensurepass 2018 PDF and VCE

  1. Compilation fails.

  2. Value is: -12

  3. Value is: 8

  4. The code runs with no output.

  5. Value is: 12

  6. An exception is thrown at runtime.

    Answer: C

    Question No: 185 – (Topic 2)

    Given:

    1. public class TestOne implements Runnable {

    2. public static void main (String[] args) throws Exception {

    3. Thread t = new Thread(new TestOne());

    4. t.start();

    5. System.out.print(quot;Startedquot;);

    6. t.join();

    7. System.out.print(quot;Completequot;); 8. }

9. public void run() {

10. for (int i = 0; i lt; 4; i ) {

11. System.out.print(i);

12. }

13. }

14. }

What can be a result?

  1. The code executes and prints quot;Started0123Completequot;.

  2. An exception is thrown at runtime.

  3. Compilation fails.

  4. The code executes and prints quot;StartedCompletequot;.

  5. The code executes and prints quot;StartedComplete0123quot;.

Answer: A

Question No: 186 – (Topic 2)

Given: 1. public class TestString3 { 2. public static void main(String[] args) { 3. // insert code here 5. System.out.println(s); 6. } 7. } Which two code fragments, inserted independently at line 3, generate the output 4247? (Choose two.)

A. StringBuilder s = new StringBuilder(quot;123456789quot;);

B. delete(0,3).delete(1,3).delete(2,5).insert(1, quot;24quot;);

C. StringBuffer s = new StringBuffer(quot;123456789quot;);

D. delete(0,3).replace(1,3,quot;24quot;).delete(4,6);

E. String s = quot;123456789quot;;

s = (s-quot;123quot;).replace(1,3,quot;24quot;) – quot;89quot;;

  1. StringBuilder s = new StringBuilder(quot;123456789quot;);

  2. substring(3,6).delete(1,2).insert(1, quot;24quot;);

  3. StringBuffer s = new StringBuffer(quot;123456789quot;);

  4. substring(3,6).delete(1,3).insert(1, quot;24quot;);

Answer: A,B

Question No: 187 – (Topic 2)

Which three statements concerning the use of the java.io.Serializable interface are true? (Choose three.)

  1. The values in fields with the transient modifier will NOT survive serialization and deserialization.

  2. The values in fields with the volatile modifier will NOT survive serialization and deserialization.

  3. An object serialized on one JVM can be successfully deserialized on a different JVM.

  4. It is legal to serialize an object of a type that has a supertype that does NOT implement java.io.Serializable.

  5. Objects from classes that use aggregation cannot be serialized.

Answer: A,C,D

Question No: 188 – (Topic 2)

Given:

  1. interface DeclareStuff {

  2. public static final int EASY = 3;

  3. void doStuff(int t); }

  4. public class TestDeclare implements DeclareStuff {

  5. public static void main(String [] args) {

  6. int x = 5;

  7. new TestDeclare().doStuff( x);

18. }

  1. void doStuff(int s) {

  2. s = EASY s;

  3. System.out.println(quot;s quot; s);

22. }

23. }

What is the result?

  1. s 10

  2. s 16

  3. An exception is thrown at runtime.

  4. Compilation fails.

  5. s 14

Answer: D

Question No: 189 – (Topic 2)

Given:

  1. public static void main(String[] args) {

  2. String str = quot;nullquot;;

  3. if (str == null) {

  4. System.out.println(quot;nullquot;);

  5. } else (str.length() == 0) {

  6. System.out.println(quot;zeroquot;);

  7. } else {

  8. System.out.println(quot;somequot;);

19. }

20. }

What is the result?

  1. An exception is thrown at runtime.

  2. some

  3. zero

  4. Compilation fails.

  5. null

Answer: D

Question No: 190 – (Topic 2)

Given:

  1. interface Foo {}

  2. class Alpha implements Foo {}

  3. class Beta extends Alpha {}

  4. class Delta extends Beta {

  5. public static void main( String[] args ) {

  6. Beta x = new Beta();

  7. // insert code here

17. }

18. }

Which code, inserted at line 16, will cause a java.lang.ClassCastException?

  1. Beta b = (Beta)(Alpha)x;

  2. Foo f = (Alpha)x;

  3. Alpha a = x;

  4. Foo f = (Delta)x;

    Answer: D

    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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.