Missing value in Java

后端 未结 11 2767
慢半拍i
慢半拍i 2021-02-20 11:51

What is the statement that can be used in Java to represent a missing value of a variable. for instance I want to write a code:

if (a>=23)
 income = pay_rate;         


        
11条回答
  •  遥遥无期
    2021-02-20 12:17

    Double income = null;
    if (a>=23) {income = pay_rate; }
    

    income would be null by default so if uninitialized

提交回复
热议问题