AllExam Dumps

DUMPS, FREE DUMPS, VCP5 DUMPS| VMWARE DUMPS, VCP DUMPS, VCP4 DUMPS, VCAP DUMPS, VCDX DUMPS, CISCO DUMPS, CCNA, CCNA DUMPS, CCNP DUMPS, CCIE DUMPS, ITIL, EXIN DUMPS,


READ Free Dumps For Oracle- 1z0-803





Question ID 21937

Given the code fragment:
String h1 = "Bob";
String h2 = new String ("Bob");
What is the best way to test that the values of h1 and h2 are the same?

Option A

if (h1 == h2)

Option B

if (h1.equals(h2))

Option C

if (h1 = = h2)

Option D

if (h1.same(h2))

Correct Answer B
Explanation Explanation: The equals method compares values for equality. Incorrect answers: The strings are not the same objects so the == comparison fails. See note #1 below. As the value of the strings are the same equals is true. The equals compares values for equality. There is no generic comparison method named same. = = (with a space) is not a valid method. Note: #1 == Compares references, not values. The use of == with object references is generally limited to the following: Comparing to see if a reference is null. Comparing two enum values. This works because there is only one object for each enum constant. You want to know if two references are to the same object.


Question ID 21938

Which two are valid declarations of a two-dimensional array?

Option A

int[][] array2D;

Option B

int[2][2] array2D;

Option C

int array2D[];

Option D

int[] array2D[]; 

Option E

int[][] array2D[];

Correct Answer A,D
Explanation Explanation: int[][] array2D; is the standard convention to declare a 2-dimensional integer array. int[] array2D[]; works as well, but it is not recommended. Incorrect answers: int[2][2] array2D; The size of the array cannot be defined this way. int array2D[]; is good definition of a one-dimensional array. int[] []array2D[];is good definition of a threedimensional array.

Send email to admin@getfreedumps for new dumps request!!!