Web Services Development MCQs with Answers
Practice important Web Services Development MCQs with answers and explanations.
Multiple Choice Questions
Q151: The size of an array in Java is determined by the _______.
- A: array reference variable
- B: data type
- C: array size declarator
- D: compiler
View Answer
C
Q152: How many elements can the array 'dailySales' hold if it is declared as 'double[] dailySales = new double[7];'?
- A: 7
- B: 10
- C: 5
- D: 15
View Answer
A
Q153: Which of the following statements correctly initializes an array named num with 10 integers?
- A: int[] num = new int[10];
- B: int[] num = new int[5];
- C: int num = new int[10];
- D: int[] num;
View Answer
C
Q154: In a one-dimensional array, how are elements stored in memory?
- A: In a line
- B: Row-wise
- C: Column-wise
- D: Randomly
View Answer
A
Q155: In a two-dimensional array, elements are stored _______.
- A: row-wise
- B: column-wise
- C: in a zigzag pattern
- D: in a line
View Answer
A
Q156: A multi-dimensional array can be considered as _______.
- A: an array of arrays
- B: a single list of elements
- C: a simple array
- D: none of these
View Answer
A
Q157: What is the correct way to iterate over a one-dimensional array in Java?
- A: using a for loop
- B: using a while loop
- C: using a do-while loop
- D: using a switch statement
View Answer
A
Q158: To iterate over a two-dimensional array, we use _______.
- A: a single for loop
- B: two nested for loops
- C: a while loop
- D: a do-while loop
View Answer
B
Q159: Which method is used to get the length of an array dimension in a multidimensional array?
- A: GetLength()
- B: GetLowerBound()
- C: GetUpperBound()
- D: GetArraySize()
View Answer
A
Q160: Which of the following is TRUE about pseudo-random numbers generated by java.util.Random?
- A: They are completely random
- B: They are predictable
- C: They are not truly random
- D: They are cryptographically secure
View Answer
C