Static Keyword

PHOTO EMBED

Tue Sep 14 2021 12:51:55 GMT+0000 (Coordinated Universal Time)

Saved by @yinmaster #apex #salesforce #trigger #static #keywords

public class TestClass {
    
    public Static Integer copies = 0;
    
    
    public TestClass(){
        this.add();
    }
    
       
    public void add(){
        copies++;
    } 
    
    public Static void subtract(){
        copies--;
        System.debug(copies);
    } 


}
content_copyCOPY