What is the best way to test that the values of h1 and h2 are the same?

Given the code fragment: What is the best way to test that the values of h1 and h2 are the
same?

Given the code fragment: What is the best way to test that the values of h1 and h2 are the
same?

A.
if (h1.equals(h2))

B.
if (h1 = = h2)

C.
if (h1.same(h2))

D.
if (h1 = = h2)



Leave a Reply 2

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


imyrta

imyrta

Answer: A

Explanation:
Because the equals method is used to compare values for equality.