Activity Forums Salesforce® Discussions What is virtual class ?

  • shariq

    Member
    September 22, 2018 at 11:29 am

    In protest situated programming, a virtual class is a settled inward class whose capacities and part factors can be abrogated and reclassified by subclasses of the external class. Virtual classes are closely resembling virtual capacities.

  • Parul

    Member
    September 22, 2018 at 11:44 am

    Addins some points:

    Virtual Classes like abstract classes but unlike interfaces can have constructors.
    Virtual classes constructors can be called directly and they can be instantiated unlike interfaces
    It is not mandatory to override virtual methods   So it’s great
    Even an abstract class can extend virtual classes ;), remember, this is not possible for interfaces, they can’t have any method bodies, so no point extending virtual classes

     

    Thanks

  • Parul

    Member
    September 22, 2018 at 12:37 pm

    Virtual class are functional classes and can be instantiated or extended without then need of overriding methods.

     

    virtual class

    child class interact with parent class using extend keyword

     

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos