hello everyone, i am a java student and got stuck on a question. can someone help me UNDERSTANDING and SOLVING the question. your help will be greatly appreciated.help me understand the question,i do not want codes. NO STUPID ANSWER please
Applying the object-oriented concepts of encapsulation and inheritance, implement a
super class called MyCounter with an integer instance variable called value. The class
has a default constructor and a user-defined constructor. Its public interface has one
permissible operation called accessValue() which allows return of its instance variable.
Implement 2 subclasses of MyCounter called CountUp and CountDn. The CountUp
class with its derived constructors defines an increment counter that provides the
increment privilege called increment(). The CountDn class defines a decrement counter
that provides the decrement privilege called decrement().
Implement a class called TestMyCounter which will simulate the 2 instances of subclass
(i). To increment an object of CountUp (with initialize value 11) by 100 times and
display the final value of its instance variable.
(ii). To decrement an object of CountDn (with initialize value 22) by 19 times and display
the final value of its instance variable.
Page 1 of 1
4 Replies - 878 Views - Last Post: 09 October 2011 - 02:41 PM
Replies To: abstract classes
Page 1 of 1