java - Can new File() constructor return null on Android? -


i saw code in android training center website:

boolean hasexternalstorageprivatefile() {     // path file on external storage.  if external     // storage not mounted fail.     file file = new file(getexternalfilesdir(null), "demofile.jpg");     if (file != null) {         return file.exists();     }     return false; } 

does mean on android new file() can return null?

http://developer.android.com/reference/android/content/context.html#getexternalfilesdir(java.lang.string)

no, constructor may never return null. constructor either returns initialised object or throws exception or error.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -