Missing value in Java

后端 未结 11 2824
慢半拍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:04

    You need to Initialize varible with null

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

提交回复
热议问题