Question: In java programming pls Design and code a class Even that has the following properties: A private integer member that is always even. A default
In java programming pls Design and code a class Even that has the following properties: A private integer member that is always even. A default constructor that sets num to 0 A constructor that accepts an integer and sets num to the closed (up) even (if the number is odd, num will be set to the number+1) Accessor for num Mutator for num a method next() that returns the next Even number after num a method display that displays num a method isEqual that accepts an Even object and returns true if the two objects have the same number (num) a method Add that accepts an object and returns the an Even object that is the sum of this and the input object. Write a Tester where you test all methods and constructors of the class Even
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
