Possible error in ocp-816 (1/62)
Posted: Mon Feb 10, 2020 6:42 am
Hi guys)
This is foundation test question 62:
Fifth option regarding the use of is misleading.
Explanation said that all is not allowed, although if you run
As you see all is real value to disable all warnings.
This is foundation test question 62:
Fifth option regarding the use of
Code: Select all
@SuppressWarnings("all")
Explanation said that all is not allowed, although if you run
and go to -Xlint section you will see the full list of possible values.javac -X
Code: Select all
-Xlint:<key>(,<key>)*
Warnings to enable or disable, separated by comma.
Precede a key by - to disable the specified warning.
Supported keys are:
all Enable all warnings
auxiliaryclass Warn about an auxiliary class that is hidden in a source file, and is used from other files.
cast Warn about use of unnecessary casts.
classfile Warn about issues related to classfile contents.
deprecation Warn about use of deprecated items.
dep-ann Warn about items marked as deprecated in JavaDoc but not using the @Deprecated annotation.
divzero Warn about division by constant integer 0.
empty Warn about empty statement after if.
exports Warn about issues regarding module exports.
fallthrough Warn about falling through from one case of a switch statement to the next.
finally Warn about finally clauses that do not terminate normally.
module Warn about module system related issues.
opens Warn about issues regarding module opens.
options Warn about issues relating to use of command line options.
overloads Warn about issues regarding method overloads.
overrides Warn about issues regarding method overrides.
path Warn about invalid path elements on the command line.
processing Warn about issues regarding annotation processing.
rawtypes Warn about use of raw types.
removal Warn about use of API that has been marked for removal.
requires-automatic Warn about use of automatic modules in the requires clauses.
requires-transitive-automatic Warn about automatic modules in requires transitive.
serial Warn about Serializable classes that do not provide a serial version ID.
Also warn about access to non-public members from a serializable element.
static Warn about accessing a static member using an instance.
try Warn about issues relating to use of try blocks (i.e. try-with-resources).
unchecked Warn about unchecked operations.
varargs Warn about potentially unsafe vararg methods
preview Warn about use of preview language features
none Disable all warnings