eyvallah hocam çok saol bunlar işimi görur herhalde birde internette java için hazır kod bulabilirmiyim (ödev verilince direk ordan bulsam yani kendim yazmakla uğraşmasam)
We are going to extend the functionality of the Counter class discussed in the lectures.
Give Counter a new method called decrementCount that decreases by one the current count of the Counter. Give Counter a new constructor that takes as argument an existing Counter and initializes the count of the new counter being created with the current count of the Counter supplied as an argument. Give Counter a new method called add that takes as argument another Counter that adds to this counter's count the count value of the argument Counter. Give Counter a new method called repeat that changes the count by the same amount that the last method that incremented or decremented the counter did. For example, if the last change was +1, from an incrementCount, +1 is added again to the count. If the last change was -1, from a decrementCount, -1 is added again to the count. If the last change was a different value, as the result of an add call, that change should be applied again to the count. If the count has just been reset, repeat should just not change the count from its initial value of 0. To make this work, Counter must be given an additional piece of state to remember the last change. Here are some DrJava interactions with the class
DH forumlarında vakit geçirmekten keyif alıyor gibisin ancak giriş yapmadığını görüyoruz.
Üye Ol Şimdi DeğilÜye olduğunda özel mesaj gönderebilir, beğendiğin konuları favorilerine ekleyip takibe alabilir ve daha önce gezdiğin konulara hızlıca erişebilirsin.