Nov-2023 Download Free Latest Exam 1z1-811 Certified Sample Questions [Q17-Q42]

Share

Nov-2023 Download Free Latest Exam 1z1-811 Certified Sample Questions

Prepare for your exam certification with our 1z1-811 Certified Oracle

NEW QUESTION # 17
Given the code fragment:

What is the result?

  • A. 3 : 2
  • B. 0 : 1
  • C. 2 : 0
  • D. 3 : 1

Answer: A


NEW QUESTION # 18
Given the code fragment:

Which code fragment, when inserted at line n1, enables the code to print Java Programming:1?

  • A. System.out.println(c.name + ":" + Course.count);
  • B. System.out.println(Course.name + ":" + c.count);
  • C. System.out.println(c.name + ":" + count);
  • D. System.out.println(name + ":" + count);

Answer: A


NEW QUESTION # 19
Given the code fragment:

Which statement, when inserted at line n1, enables the code to print 0 2 4 6 8 10?

  • A. count =+ 2;
  • B. count += 2;
  • C. count = count++;
  • D. count = (count++) +1;

Answer: B


NEW QUESTION # 20
Which statement is true about exception handling?

  • A. At least one statement in a try block must throw an exception.
  • B. At least one catch block must accompany a try statement.
  • C. All statements in a try block are executed, even if an exception occurs in the middle of the try block.
  • D. All catch blocks must be ordered from general to most specific.

Answer: D


NEW QUESTION # 21
Given the code fragment:

Which two code fragments are valid at line 2?

  • A. {
    private int num;
    }
  • B. private String name = "John";
    public void display() {
    System.out.print(name);
    }
  • C. import java.util.*;
    public void display() {
    List<Integer> nums = new ArrayList<> ();
    }
  • D. for (int count = 0; count < 5; count++) {
    System.out.print(count);
    }
  • E. package p1;

Answer: B,E


NEW QUESTION # 22
Identify two class variables.

  • A. public static int counter = 0;
  • B. private Measure cm;
  • C. public int size = 10;
  • D. int scale = 35;
  • E. private static int numberOfSquares = 20;

Answer: A,E


NEW QUESTION # 23
Given the code fragment:

What is the result?

  • A. A runtime exception is thrown.
  • B. 10 20
    10 20
  • C. 10 20
    10 15 20
  • D. A compilation error occurs.

Answer: D


NEW QUESTION # 24
Given the code fragment:

What is the result?

  • A. [betaTest]
  • B. [ BETATEST ]
  • C. [ betaTest ]
  • D. [BETATEST]

Answer: D


NEW QUESTION # 25
Given:

And the code fragment:

Which code fragment can be inserted at line n1 to enable the code to print All the best?

  • A. Messenger.writeMsg();
  • B. m.writeMsg();
  • C. void writeMsg();
  • D. writeMsg();

Answer: A


NEW QUESTION # 26
Which method identifier is correct according to Java naming conventions?

  • A. BillCalculator
  • B. calculateBill
  • C. Calculator
  • D. calculatebill

Answer: C


NEW QUESTION # 27
Given the code fragment:

Which code fragment can be inserted at line n1 to enable the code to compile?

  • A. int[] num;
  • B. int[10] num;
  • C. new int num[];
  • D. int num[10];

Answer: A


NEW QUESTION # 28
Given:

Which statement, when inserted at line n1, enables the Course class to compile?

  • A. long newFee;
  • B. double newFee;
  • C. int newFee;
  • D. float newFee;

Answer: B


NEW QUESTION # 29
Given the code fragment:

Which code fragment can be inserted at line n1 to enable the code to print 0.0?

  • A. Ball b = new Ball();
  • B. Ball.weight = 0.0;
  • C. Ball b = new Ball(0.0);
  • D. Ball b = null;
    b.weight = 0.0;

Answer: A


NEW QUESTION # 30
Which two Java reserved words are used to implement encapsulation?

  • A. extends
  • B. private
  • C. static
  • D. public
  • E. final

Answer: B,D


NEW QUESTION # 31
Given the code fragment:

Which statement is true?

  • A. A compilation error occurs at line 3.
  • B. The code compiles without errors.
  • C. A compilation error occurs at line 7.
  • D. A compilation error occurs at line 5.

Answer: B


NEW QUESTION # 32
Given the code fragment:

At which line does a compilation error occur?

  • A. line 5
  • B. line 7
  • C. lines 5 and 7
  • D. lines 6 and 8

Answer: A


NEW QUESTION # 33
Given these class definitions:

Which class or classes compile?

  • A. MyClassA, MyClassB, MyClassC, and MyClassD
  • B. only MyClassB and MyClassD
  • C. only MyClassB, MyClassC, and MyClassD
  • D. only MyClassB

Answer: B


NEW QUESTION # 34
Given the code fragment:

What is the result?

  • A. pen pencil erasers paper
  • B. A compilation error occurs.
  • C. paper pen pencil erasers
  • D. A runtime exception is thrown.

Answer: D


NEW QUESTION # 35
Given the code fragment:

What is the result?

  • A. false
    true
  • B. true
    true
  • C. true
    false
  • D. false
    false

Answer: B


NEW QUESTION # 36
Given the code fragment:

Which code fragment, when inserted at line n1, enables the code to print one?

  • A. String var = 1;
  • B. char var = '1';
  • C. String var = "1";
  • D. int var = 1;

Answer: C


NEW QUESTION # 37
Given the contents of the Test.java file:

What is the result?

  • A. 200 : 400
  • B. A compilation error occurs at line n2.
  • C. 100 : 400
  • D. A compilation error occurs at line n1.

Answer: B


NEW QUESTION # 38
Given the code fragment:

What is the result?

  • A. [jasmine, rose, lotus, lily]
  • B. A runtime exception is thrown.
  • C. [jasmine, rose, lily]
  • D. [jasmine, lily, lotus]

Answer: B


NEW QUESTION # 39
Given the code fragment:

Which statement is true?

  • A. The code results in a compilation error. To make it compile, insert at line n1:
    import java.lang;
    import java.util;
  • B. The code compiles successfully
  • C. The code results in a compilation error. To make it compile, insert at line n1:
    import java.util.*;
  • D. The code results in a compilation error. To make it compile, insert at line n1:
    import java.lang.Math;
    import java.lang.Random;

Answer: B


NEW QUESTION # 40
Identify two valid data types for the operands of the addition (+) operator?

  • A. string
  • B. numeric
  • C. boolean
  • D. array

Answer: A,D


NEW QUESTION # 41
Identify three features of the Java programming language.

  • A. dynamically typed
  • B. distributed
  • C. multithreaded
  • D. strongly typed
  • E. direct memory management

Answer: A,B,C


NEW QUESTION # 42
......

Free Oracle 1z1-811 Exam 2023 Practice Materials Collection: https://freetorrent.actual4dumps.com/1z1-811-study-material.html