Skip to content

Instantly share code, notes, and snippets.

@sfmishra
Last active February 2, 2019 10:49
Show Gist options
  • Save sfmishra/c84de5d5384036141b24b00b0c71b76a to your computer and use it in GitHub Desktop.
Save sfmishra/c84de5d5384036141b24b00b0c71b76a to your computer and use it in GitHub Desktop.
/**
* Abstract Controller, contains instance variable, constructor.
* Abstract class cannot be instantiated and contains one abstract method.
*/
public abstract class AbstractController {
public Integer result;
public Integer getresult() {
if(result != null) {
return result;
} else {
return null;
}
}
public void setResult(Integer result) {
this.result = result;
}
public AbstractController() {
system.debug(' Abstract constructor called ');
}
// this method needs to be implemented by all class extending this
public abstract Integer calculate(Integer val1, Integer val2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment