πŸ“Š JAVA
Q. What is the result of compiling and running the following code?
Code:
public class Test{
        public static void main(String[] args){
                int[] a = new int[0];
                System.out.print(a.length);
        }
}
  • (A) 0
  • (B) Compilation error, arrays cannot be initialized to zero size.
  • (C) Compilation error, it is a.length() not a.length
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) 0

Explanation: Step 1:

Explanation by: Neelam Mittal
Step 1:

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
69
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Neelam Mittal
Publisher
πŸ“ˆ
97%
Success Rate