Addition of numbers in Apex

Addition of numbers in Apex-


public class AddNumbers {     

public static void addnums(integer a, integer b){  

integer c = a+b;       

system.debug('----->' +c);   

}

}


To test-


Call this from Anonymous window-

AddNumbers.addnums(1,2);

Comments