Activity Forums Salesforce® Discussions What is polymorphism in Salesforce?

  • Kirandeep

    Member
    August 18, 2020 at 11:00 am

    The word polymorphism means having many forms.Polymorphism ” is the ability of one type, A, to appear as and be used like another type, B.” ... That's right we need a list of classes, so they need to be the same class type, but the same method in each must return different values (let's assume without the use of conditional logic statements).

  • Anuj

    Member
    August 18, 2020 at 12:43 pm

    Polymorphism in Apex requires an Apex Interface to be implemented or Class that can be extended by other Apex classes e.g. Virtual or Abstract classes. The implementing or extending classes can then be used in a predictable, consistent way even though their types are different from one another.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos