πŸ“Š 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, it is a.length() not a.length
  • (C) Compilation error, arrays cannot be initialized to zero size.
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) 0

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
210
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Shivam
Publisher
πŸ“ˆ
87%
Success Rate