ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 63 - Certified B2C Commerce Developer discussion

Report
Export

A developer is asked to write a log containing the ID and name of the product with a variable named myProduct.

Which snippet of code should be used?

A.
Logger.warn('The current product is ${myProduct.getID()} with name ${myProduct.getName()}');
Answers
A.
Logger.warn('The current product is ${myProduct.getID()} with name ${myProduct.getName()}');
B.
Logger.warn('The current product is {0} with name {1}', myProduct.getID(), myProduct.getName());
Answers
B.
Logger.warn('The current product is {0} with name {1}', myProduct.getID(), myProduct.getName());
C.
Logger.warn('The current product is %s with name %s').context(myProduct.getID(), myProduct.getName());
Answers
C.
Logger.warn('The current product is %s with name %s').context(myProduct.getID(), myProduct.getName());
D.
Logger.warn('The current product is {0} with name {1}'}.context(myProduct.getID(), myProduct.getName());
Answers
D.
Logger.warn('The current product is {0} with name {1}'}.context(myProduct.getID(), myProduct.getName());
Suggested answer: B
asked 23/09/2024
annalise ramdin
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first