fork download
  1. interface Answerer {
  2. public boolean getAnswer();
  3. }
  4. class abstract AbstractAnswerer implements Answerer {
  5. private boolean answer;
  6. private boolean input1;
  7. private boolean input2;
  8. public AbstractAnswerer(boolean input1, boolean input2) {
  9. this.input1 = input1;
  10. this.input2 = input2;
  11. }
  12. @Override public final boolean getAnswer() {
  13. this.answer = computeAnswer(input1, input2);
  14. return this.answer;
  15. }
  16. protected abstract boolean computeAnswer(boolean input1, boolean input2);
  17.  
  18. }
  19. class ConcreteAnswerer extends AbstractAnswerer {
  20. public ConcreteAnswerer(boolean input1, boolean input2) {
  21. super(input1, input2);
  22. }
  23. @Override protected boolean computeAnswer(boolean input1, boolean input2) {
  24. if(input1 && !input2) return true;
  25. else return false;
  26. }
  27. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty