Given the code fragment:
What is the result?
A. A compilation error occurs at line n1.
B. Checking…
C. Checking…
Checking…
D. A compilation error occurs at line n2.
Given the code fragment:
What is the result?
A. A compilation error occurs at line n1.
B. Checking…
C. Checking…
Checking…
D. A compilation error occurs at line n2.
D
D
D. A compilation error occurs at line n2
because in order to pass a string, we need to specify Predicate
otherwise, it is assumed that the parameter is of type Object
and Object does not have a length method
so a compilation error occurs
we need to specify
Predicate
Predicate
C