What is the result?

Given the code fragment:

What is the result?
A. Match 1
B. Match 2
C. No Match
D. A NullPointerException is thrown at runtime.

Download Printable PDF. VALID exam to help you PASS.

One thought on “What is the result?

  1. B is correct . The StringBuilder object and the string object are logically equal, but they are different types of objects and will never be equal.

    The StringBuilder object is logically equal to the string object after it is converted into a string. They are all empty strings, so they are equal and output “Match 2”.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.