Return to site

JAVA CERTIFICATION QUESTION: Secure coding

Here’s what happens when good code meets bad people.

· java,ocp

You are developing a highly loaded, multithreaded stock-quote analysis application.

During a security audit, you were advised to make a defensive copy of stock-quote data as you receive it for analysis,

isolating the calculations from any modifications made to the original input data.

Given this StockQuote class:

and this method, which should protect itself by making a copy:

Which code line (if any) can protect you from malicious modifications made to the stock-quote data during the processing? Choose one.

A.

B.

C.

D.

E. None of the above

 

·Ǝ sᴉ ɹǝʍsuɐ ʇɔǝɹɹoɔ ǝɥꓕ