Activity Forums Salesforce® Discussions What is virtual class in Salesforce?

  • Aditya

    Member
    July 20, 2020 at 4:00 pm

    Hi,
    The global access modifier declares that this class is known by all Apex code everywhere. ... The virtual definition modifier declares that this class allows extension and overrides. You cannot override a method with the override keyword unless the class has been defined as virtual .

  • Anuj

    Member
    July 20, 2020 at 4:25 pm

    In object-oriented programming, a virtual class is a nested inner class whose functions and member variables can be overridden and redefined by subclasses of an outer class. Virtual classes are analogous to virtual functions.

  • Ratnesh

    Member
    July 21, 2020 at 6:16 am

    <div data-md="61" lang="en-IN"><div aria-level="3" role="heading" data-attrid="wa:/description" data-hveid="CA8QAg">The virtual definition modifier declares that this class allows extension and overrides.<div><div data-hveid="CA8QAw" data-ved="2ahUKEwi8z43l2N3qAhVY63MBHciJDNMQFSgCMAF6BAgPEAM">
    </div></div></div></div>

  • Ayush

    Member
    July 21, 2020 at 10:31 am

    The<b id="ext-gen37"> virtual definition modifier declares that this class allows extension and overrides. You cannot override a method with the override keyword unless the class has been defined as virtual.

Log In to reply.

Popular Salesforce Blogs