方法文档中 java doc 和 Android doc 的区别
Difference between java doc and Android doc in method documents
有时我在 about 方法 documents.For 示例中看到 Java doc 和 Android doc 之间存在问题的差异,您可以在 about setReadable (boolean readable, boolean ownerOnly)
方法中看到 java doc说:
Throws: SecurityException - If a security manager exists and its
SecurityManager.checkWrite(java.lang.String) method denies write
access to the file
但是Android docs does not say any thing about throwing exception.Also we know that Docs say:
Any Exception that can be thrown by a method is part of the method's
public programming interface. Those who call a method must know about
the exceptions that a method can throw so that they can decide what to
do about them.
所以当我们在方法的 Android 文档中没有看到任何抛出条件时,
- 这是否意味着方法不会以任何方式抛出异常?或者它可能被遗忘?
- Java 和 Android 之间的概率差异是否需要通过任何简单方法检查文档?可能吗?
您可能已经知道,由于代码的关闭,您的代码在 运行 时可能会出现异常。简而言之,您可能正在安全且正确地使用一种方法,但围绕它的特定代码块可能容易受到某些异常和条件的影响。此外,android 文档可能会因原生 java 库的引用不佳而受到影响,并且 apis.Because 他们假设您是一位经验丰富的 java 开发人员并且熟悉使用 java 文档.
如果您转到 setReadable(bool,bool) 的声明,您会看到捕获到异常并返回 false。所以在这种情况下,Android 文档取代了 Javadoc。
有时我在 about 方法 documents.For 示例中看到 Java doc 和 Android doc 之间存在问题的差异,您可以在 about setReadable (boolean readable, boolean ownerOnly)
方法中看到 java doc说:
Throws: SecurityException - If a security manager exists and its SecurityManager.checkWrite(java.lang.String) method denies write access to the file
但是Android docs does not say any thing about throwing exception.Also we know that Docs say:
Any Exception that can be thrown by a method is part of the method's public programming interface. Those who call a method must know about the exceptions that a method can throw so that they can decide what to do about them.
所以当我们在方法的 Android 文档中没有看到任何抛出条件时,
- 这是否意味着方法不会以任何方式抛出异常?或者它可能被遗忘?
- Java 和 Android 之间的概率差异是否需要通过任何简单方法检查文档?可能吗?
您可能已经知道,由于代码的关闭,您的代码在 运行 时可能会出现异常。简而言之,您可能正在安全且正确地使用一种方法,但围绕它的特定代码块可能容易受到某些异常和条件的影响。此外,android 文档可能会因原生 java 库的引用不佳而受到影响,并且 apis.Because 他们假设您是一位经验丰富的 java 开发人员并且熟悉使用 java 文档.
如果您转到 setReadable(bool,bool) 的声明,您会看到捕获到异常并返回 false。所以在这种情况下,Android 文档取代了 Javadoc。