What is output of the following code:

```
public class Test {
public static void main(String[] args) {
int[] x = {120, 200, 016};
for (int i = 0; i < x.length; i++)
System.out.print(x[i] + " ");
}
}```
a. 120 200 16
b. 120 200 14
c. 120 200 20
d. 016 is a compile error. It should be written as 16.


b 016 is an octal number. The prefix 0 indicates that a number is in octal.

Computer Science & Information Technology

You might also like to view...

Which of the following is the last step in NIST’s recommended steps to establish or improve a cybersecurity program?

A) Implement the action plan B) Orient your strategy C) Determine, analyze, and prioritize any gaps D) Create a target profile

Computer Science & Information Technology

Which of the following statements are true?

a. Inner classes can make programs simple and concise. b. An inner class can be declared public or private subject to the same visibility rules applied to a member of the class. c. An inner class can be declared static. A static inner class can be accessed using the outer class name. A static inner class cannot access nonstatic members of the outer class. d. An inner class supports the work of its containing outer class and is compiled into a class named OuterClassName$InnerClassName.class.

Computer Science & Information Technology

Based on the dangling-else discussion , modify the following code to produce the output shown. Use proper indentation techniques. You must not make any additional changes other than inserting braces. We eliminated the indentation from the following code to make the problem more challenging

``` if (y == 8) if (x == 5) cout << "@@@@@" << endl; else cout << "#####" << endl; cout << "$$$$$" << endl; cout << "&&&&&" << endl; ``` Assuming x = 5 and y = 8, the following output is produced. ``` @@@@@ &&&&& ```

Computer Science & Information Technology

What type of algorithm is list indexing an example of?

A. constant-time B. logarithmic-time C. exponential-time D. linear-time

Computer Science & Information Technology