A

Admin • 37.26K Points
Coach

Q. What is the type of variables “b” and “d” in the following code?

Code:
int a[], b;
int []c, d;
  • (A) ‘b’ and ‘d’ are of type int
  • (B) ‘b’ and ‘d’ are arrays of type int
  • (C) ‘b’ is a variable of type int; ‘d’ is an array of type int
  • (D) ‘d’ is a variable of type int; ‘b’ is an array of type int
  • Correct Answer - Option(C)
  • Views: 172
  • Filed under category JAVA

Explanation by: Admin
If square brackets [] is declared after the variable, it only applies to a single variable. If square brackets [] is declared before the variable, it applies to all variables.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics