You need to sign in to do that
Don't have an account?

when we will use virtual method and non-virtual in salesforce????
when we will use virtual method and non-virtual in salesforce????
Virtual methods are used when the author expects an extension class to override the behaviour in certain circumstances. For example, a superclass that saves an account may define a virtual preSave() method to set up some related information prior to save. A subclass that extends the superclass may have different related information requirements, in which case the preSave() method would be overridden and replaced with a method that carries out processing specific to the subclass. This allows the subclass to take advantage of most of the functionality that the superclass provides, while replacing functionality as required for its specific requirements.