Activity Forums Salesforce® Discussions WHat is the difference between if-else statement and ternary operatory in apex?

  • WHat is the difference between if-else statement and ternary operatory in apex?

    Posted by Kirandeep on September 16, 2020 at 2:41 pm

    WHat is the difference between if-else statement and ternary operatory in apex ?

    • This discussion was modified 4 years, 3 months ago by  Kirandeep.
    Deepak replied 4 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Deepak

    Member
    September 16, 2020 at 3:01 pm

    A ternary operator takes three arguments. The first one is the condition, the second one is executed if the condition is true, and the third one is executed if the condition is false. In lf else just check for the condition in if part and if satisfies then good otherwise it goes for else part.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos