android 中可为空 属性

nullable property in android

我创建了一个具有 get 和 set 方法的浮点数 属性。当我将空值发送到 set 方法时,get 方法 return 0.0 值。 当我将 null 发送到 属性 时,我需要 null 值。
我该怎么办?

我应该写浮动而不是浮动;