Oracle Certified Associate Java Se 8 Programmer · Free Practice Question Easy

Question 21

public class ArrayByteTest {

public static void main(String[] args) {

byte[] values = new byte[]{20, 30};

values[0] = 15;

values[1] = 25;

System.out.println("[" + values[0] + ", " + values[1] + "]"); }

}

What will be the result of compiling and executing the ArrayByteTest class?

  • A

    [20, 30]

  • B

    [15, 25]

  • C

    [5, 10]

  • D

    Compilation error

Reveal correct answer

Correct answer: B

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need