20732
Write a class named Accumulator containing:
An instance variable named sum of type integer , initialized to 0.
A method named getSum that returns the value of sum .
A method named add that accepts an integer parameter . The value of sum is increased by the value of the parameter .
ANSWER

  public class Accumulator{
            private int sum = 0;
            public int getSum(){
                        return sum;
            }
            public void add(int number){
                        sum += number;
            }
}
20631.
Write the definition of a class Clock . The class has no constructors and three instance variables . One is of type int called hours , initialized to 12 , another is of type boolean called isTicking , and the last one is of type  Integer called diff .
Answer
public class Clock
{
private int hours=12;
private boolean isTicking;
private Integer diff;
}

20632.
Write the definition of a class Clock . The class has no constructors and three instance variables . One is of type int called hours , initialized to 12 , another is of type boolean called isTicking , initialized to true , and the last one is of type Integer called diff , initialized to 5 .
Answer
public class Clock
{
private int hours = 12;
private boolean isTicking = true;
private Integer diff = 5;
}