王萍 发表于 2013-8-16 13:15:57

[java interview]How can one prove that the array is notnull but empty using one line of code?

李天一 发表于 2013-8-16 14:30:36

Printargs.length. It will print 0. That means it is empty. But if it would havebeen null then it would have thrown a NullPointerException on attempting toprint args.length.
页: [1]
查看完整版本: [java interview]How can one prove that the array is notnull but empty using one line of code?