摘要:
## 1、三目表达式 获取对象的属性,判断对象是否为空,为空返回默认值 ``` C c = new C("c"); String name = c != null ? c.getName() :DEFAULT_NAME; ``` ## 2、判断不为空再赋值 ``` User user = userD 阅读全文
摘要:
常量 contants 采用接口(Interface)中变量默认为static final的特性 public interface Constants { String LOGIN_KEY = "OTA:VEHICLE:LOGIN"; } public final static String OTA 阅读全文