PD2 Tough Questions – Refresh your amygdala

Integer x = 1; Integer Y = 0;

While(x < 10){Y++;}

Will go in infinite loop because x is not being updated inside loop to break the condition.

Integer x = 1; Integer Y = 0;
While(x < 10){Y++;}

______________________

Contact con = new Contact( LastName = ‘JOHNSON’, email = ‘Web@test.com’);
Savepoint sp = Database.setSavepoint();
insert con;
Database.rollback(sp);
system.debug(con);
con.email = ‘Email@test.com’;
insert con; // insert failed due to id was initialized by salesforce