Incrementing int value using the getter setter

后端 未结 2 970
粉色の甜心
粉色の甜心 2021-01-23 06:58

I have a requirement to increment int value. So I have made getter/setter for it and I applied this logic for the increment value of int:

public class MyOrderDet         


        
2条回答
  •  一生所求
    2021-01-23 07:31

    Why do you not just do?

    public void increment() {
        count++;
    }
    

    And what is the int parameter to the increment() function for?

提交回复
热议问题