Snippets Collections
Human fred = new Human();

fred.setName('Fred');
fred.setAge(18);

fred.Run();
fred.Jump();
fred.Climb();
public class Human {
    public String Name;
    public Integer Age;
    
    public Human(){
      this.Age = 0;
    }
        
    public void setName(String Name){
        this.Name = Name;
    } 
    
    public void setAge(String Name){
        this.Age = Age;
    } 
    
    public void Run(){
        System.debug('Run');
    } 
    
    public void Jump(){
        System.debug('Jump');
    } 
    
    public void Climb(){
        System.debug('Climb');
    } 
}
public class TestClass {
    
    public Static Integer copies = 0;
    
    
    public TestClass(){
        this.add();
    }
    
       
    public void add(){
        copies++;
    } 
    
    public Static void subtract(){
        copies--;
        System.debug(copies);
    } 


}
star

Thu Sep 16 2021 17:38:28 GMT+0000 (UTC) https://www.zenintech.org/blog/creating-your-first-apex-class

#apex #salesforce #static #keywords #class

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension