Question 67 of 84 from exam PCD: Professional Cloud Developer

Question 67 of 84 from exam PCD: Professional Cloud Developer

Question

Your teammate has asked you to review the code below, which is adding a credit to an account balance in Cloud Datastore.

Which improvement should you suggest your teammate make?

public Entity creditAccount (long accountId, long
creditamount) {
Entity account = datastore.get
(keyFactory.newKey (account Id) );
account = Entity.builder (account) . set (
“palance”, account.getLong (“balance”)
+ creditAmount) .build()
datastore.put (account) ;
return account;

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A.