Apex Class
public class Calculator {
public Decimal surfaceArea(Decimal a, Decimal b, Decimal c){
Decimal sArea = 2*(a*b+b*c+a*c);
return sArea;
}
}
Anonymous Window
Calculator objA = new Calculator();
System.debug('Surface Area: '+ objA.surfaceArea(3,7,8));
Execution Log
DEBUG|Surface Area: 202