How can one prove that the array is not null but empty using one line of code? Ans. Print args.length. It will print 0. That means it is empty. But if it would have been null then it would have thrown a NullPointerException on attempting to print args.length. - Study24x7
Social learning Network
17 Nov 2023 12:48 PM study24x7 study24x7

How can one prove that the array is not null but empty using one line of code? Ans. Print args.length. It will print 0. That means it is empty. But if it would have been null then it would have thrown a NullPointerException on attempting to print args.length.

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles