Valid CRT-450 Dumps shared by EduDump.com for Helping Passing CRT-450 Exam! EduDump.com now offer the newest CRT-450 exam dumps, the EduDump.com CRT-450 exam questions have been updated and answers have been corrected get the newest EduDump.com CRT-450 dumps with Test Engine here:
A developer considers the following snippet of code: Boolean isOK; Integer x; String theString = 'Hello'; if (isOK == false && theString == 'Hello') { x = 1; } else if (isOK == true && theString == 'Hello') { x = 2; } else if (isOK == null && theString == 'Hello') { x = 3; } else { x = 4; } Based an this code, what is the value of x?
Correct Answer: C
* isOK is declared but not initialized, so its default value is null. * In the condition checks: * The first if evaluates as false because isOK == false is false. * The second else if evaluates as false because isOK == true is false. * The third else if evaluates as true because isOK == null is true and theString == 'Hello' is also true. So, the value assigned to x is 3. Reference: Apex Developer Guide: Primitive Data Types and Defaults