πŸ“Š JAVA
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
πŸ’¬ Discuss
βœ… Correct Answer: (C) ‘b’ is a variable of type int; ‘d’ is an array of type int

Explanation: 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.

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.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
229
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Admin
Publisher
πŸ“ˆ
90%
Success Rate