These questions are from Java
- if x and y are both arrays of int values which of the following shows a call to a method of the arrays class that will fill all the elements of the array with the value 25?
Ajava.util.Arrays.replace (x, 25) ;
Bjava.util.Arrays.insert (x, 25) ; I think This one
Cjava.util.Arrays.fill (x, 25) ;
Djava.util.Arrays.setAll (x, 25) ;
- If x and y are both arrays of int values, which of the following shows a call to a method of the Arrays class that will determine if the two arrays have the same contents?
Aboolean b = java.util.Arrays.compare (x, y) ;
Bboolean b = java.util.Arrays.equals (x, y) ;
C)boolean b = java.util.Arrays.check (x, y) ; I say this one
Dboolean b = java.util.Arrays.binaryCompare (x, y) ;
- if x is an array of int values which of the following shows a call to a method of the Arrays class that will sort its contents?
Ajava.util.Arrays.sort (x, y) ;
Bjava.util.Arrays.binarySort (x, y) ; This one?
Cjava.util.Arrays.order (x, y) ;
D.java.util.Arrays.reorder (x, y) ;
- If x is a sorted array of int values which of the following shoes a call to a method of the Arrays class that will determine if the value 7 exists in the array?
Aint loc = java.util.Arrays.search (x, 7) ;
Bint loc = java.util.Arrays.binarySearch (x, 7) ;
Cint loc = java.util.Arrays.find (x, 7) ; This one
Dint loc = java.util.Arrays.locate (x, 7) ;
Please let me know if my answers are right or wrong and why!
Thank you so much!!
Ajava.util.Arrays.replace (x, 25) ;
Bjava.util.Arrays.insert (x, 25) ; I think This one
Cjava.util.Arrays.fill (x, 25) ;
Djava.util.Arrays.setAll (x, 25) ;
Aboolean b = java.util.Arrays.compare (x, y) ;
Bboolean b = java.util.Arrays.equals (x, y) ;
Dboolean b = java.util.Arrays.binaryCompare (x, y) ;
Ajava.util.Arrays.sort (x, y) ;
Bjava.util.Arrays.binarySort (x, y) ; This one?
Cjava.util.Arrays.order (x, y) ;
Aint loc = java.util.Arrays.search (x, 7) ;
Bint loc = java.util.Arrays.binarySearch (x, 7) ;
Cint loc = java.util.Arrays.find (x, 7) ; This one
Dint loc = java.util.Arrays.locate (x, 7) ;
Thank you so much!!