[Free] 2017(Jan) EnsurePass Braindumps Oracle 1z0-850 Dumps with VCE and PDF 111-120

Ensurepass.com : Ensure you pass the IT Exams
2017 Jan Oracle Official New Released 1z0-850
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-850.html

Java Standard Edition 5 and 6, Certified Associate Exam

Question No: 111 – (Topic 1)

Which two are true? (Choose two.)

  1. A single import statement can be used to simplify access to several packages in the Java API.

  2. A single import statement can be used to simplify access to several classes in the Java API.

  3. An import statement is associated with only one class in a source file.

  4. A source file can have from zero to many import statements.

  5. If a source file has one import statement, it must be preceded by a package statement.

Answer: B,D

Question No: 112 – (Topic 1)

Which two are true about the java and javac commands? (Choose two.)

  1. java -classpath lets you specify one or more directories to be used by the JVM to locate class files.

  2. java -version will print the version of the JVM.

  3. java -classpath will print the classpath used by the JVM.

  4. javac -version will print the OS version for the machine on which the JDK is installed.

  5. javac -D lets you specify the destination directory for the compiled class files.

Answer: A,B

Question No: 113 – (Topic 1)

Which option for javac sets the destination directory for class files?

  1. -classes lt;directorygt;

  2. -d lt;directorygt;

  3. -dest lt;directorygt;

  4. -classpath lt;directorygt;

  5. -output lt;directorygt;

  6. -directory lt;directorygt;

    Answer: B

    Question No: 114 – (Topic 1)

    Given:

    1. public class Foo {

    2. int size;

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

    4. Foo f = new Foo();

    5. f.setSize(5);

    6. Foo g = f.go(f);

    7. System.out.print(f.size quot; : quot; g.size); 8. }

  1. void setSize(int s) {

  2. size = s;

11. }

  1. public Foo go(Foo g) {

  2. g.setSize(2);

  3. return g;

15. }

16. }

What is the result?

A. Compilation fails.

B. 2 : 5

C. 5 : 5

D. 2 : 2

Answer: D

Question No: 115 – (Topic 1)

Given:

  1. int time = 12;

  2. if ( time lt; 12 ) {

  3. System.out.println(quot;Good morningquot;); 9. }

  1. // insert code here

  2. System.out.println(quot;Good afternoonquot;);

12. }

  1. else if ( time gt;= 18 ) {

  2. System.out.println(quot;Good eveningquot;);

15. }

Which three, inserted independently at line 10, produce the output Good afternoon? (Choose three.)

  1. else if ( time lt; 12 || time gt; 18) {

  2. if ( time gt;= 12 amp;amp; time lt; 18 ) {

  3. else if ( time gt; 12 amp;amp; time gt;= 18 ) {

  4. else if ( time gt;= 12 || time lt; 18 ) {

  5. else if ( time gt; 12 || time lt;= 18 ) {

Answer: B,D,E

Question No: 116 – (Topic 1)

You need an algorithm that must:

Print the characters of a String, in index order

Skip all instances of the character #39;a#39; that appear in the String Given:

  1. public void foo (String s) {

  2. // insert code here 4. }

    Which two, inserted independently at line 3, correctly implement the algorithm? (Choose two.)

    1. int i = 0;

      while (i lt; s.length()) { if (s.charAt(i) != #39;a#39;) { System.out.print(i);

      } i ;

      }

    2. for(char c:s) {

      if (c != #39;a#39;) System.out.print(c);

      }

    3. for(int i = 0; i lt; s.length(); i ) { char c = s.charAt(i);

      if (c != #39;a#39;) System.out.print(c);

      }

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

      if (s.charAt(i) != #39;a#39;) System.out.print(i);

      }

    5. int i = 0;

      while (i lt; s.length()) { if (s.charAt(i) != #39;a#39;) {

      System.out.print(s.charAt(i));

      } i ;

      }

      Answer: C,E

      Question No: 117 – (Topic 1)

      Which J2EE technology is used to generate dynamic content for web-based applications?

      1. JAX-RPC

      2. JNDI

      3. JMS

      4. SOAP

      5. JSP

      Answer: E

      Question No: 118 – (Topic 1)

      How can the two class paths be set for the javac compiler? (Choose two.)

      1. using the PATH environment variable

      2. using the -classpath option to java

      3. using the CLASSPATH environment variable

      4. using the -sourcepath option to javac

      5. using the -classpath option to javac

      6. using the BIN environment variable

      7. using the -classes option to javac

      Answer: C,E

      Question No: 119 – (Topic 1)

      Given:

  3. class Example {

  4. int x = 50; 6. int y = 100;

7. public static void main(String args[]) { 8. int x = 0, y = 10;

  1. Example ex = new Example();

  2. while (x lt; 3) { 11. x ; y-;

12. }

13. System.out.println(quot;x = quot; x quot; , y = quot; y);

14. }

15. }

What is the result?

  1. Compilation fails because of an error at line 10.

  2. Compilation fails because of an error at line 8.

C. x = 53 , y = 97

  1. Compilation fails because of an error at line 9.

  2. Compilation fails because of an error at line 11.

F. x = 3 , y = 7

Answer: F

Question No: 120 – (Topic 1)

Given:

  1. class TestVars {

  2. int x, y;

  3. char c;

  4. // insert code here 7. }

    Which three, inserted independently at line 6, allow the code to compile? (Choose three.)

    1. int z = x/y;

    2. boolean t = y;

    3. char d = (char) y;

    4. boolean bool = quot;falsequot;;

    5. int x = y ;

    6. int g = c;

Answer: A,C,F

100% Ensurepass Free Download!
Download Free Demo:1z0-850 Demo PDF
100% Ensurepass Free Guaranteed!
Download 2017 EnsurePass 1z0-850 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

2017 EnsurePass IT Certification PDF and VCE

Leave a Reply

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