Java SE 11 Developer — Question 34

Which two safely validate inputs? (Choose two.)

Answer options

Correct answer: A, B

Explanation

Option A is correct because delegating numeric range checks to the database ensures that validation occurs at a secure level. Option B is also correct as restricting input to valid characters helps prevent injection attacks. Options C, D, and E are incorrect; C relies on external libraries which may not be trustworthy, D is dangerous as it assumes validation has occurred, and E is misleading as modifying inputs can introduce vulnerabilities.