Are the following array initializations correct? If not, why not?

a)```
int x[4] = {8, 7, 6, 5, 4};
```
b)```
int x[] = {8, 7, 6, 5, 4};
```
c)```
int x[4] = {8, 7, 6};
```
d)```
const int SIZE =4;
int x[SIZE];
```
e)```
const int SIZE =4;
int x[SIZE-4];
```

b) c) and d) are correct.

Computer Science & Information Technology

You might also like to view...

Which of the following statements is false?

a. A class’s private helper methods may be called only by the class’s other methods b. You cannot declare helper methods in interfaces. c. An interface’s private instance methods can be called directly (i.e., without an object reference) only by the interface’s other instance methods. d. An interface’s private static methods can be called by any of the interface’s instance or static methods.

Computer Science & Information Technology

Terminal Stream operation ________ performs processing on every element in a stream (e.g., display each element).

a. forNext b. for c. forAll d. forEach

Computer Science & Information Technology