You have misread the documentation. It mentions that both directories are cleared on uninstall, however it then goes on to say [referring to the cache directory]:
although the files in this directory might be removed sooner.
So the difference is that you cannot rely on persistent files in the cache directory, they might be removed by the system.
In response to your comments, I think there's still some confusion, so let me clear some method definitions:
getCacheDir - used to store cache files. These might be deleted at anytime by the system, however they can live longer than the runtime of your app. In theory they could persist until the app is uninstalled.
getFilesDir - used to store persistent files. These should live as long as they're not cleared either manually by the user (by clearing the app data) or the app is uninstalled.
File.createTempFile - this simply creates an empty file with a unique file name with the specified prefix (if will also use a default extension .tmp and the default temporary directory if not specified otherwise). Note that there isn't a special type of temporary file, it behaves as a normal file, it's just a utility method for unique naming etc.