user image

Pooja Sharma

Job Interview Skills
English
2 years ago

17. How can one prove that the array is not null but empty using one line of code?

user image

Abhishek Mishra

2 years ago

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.

Recent Doubts

Close [x]