Can we use Optionals in Android programming?

前端 未结 3 651
-上瘾入骨i
-上瘾入骨i 2021-01-12 01:02

I have been reading about the Optional type in Java 8. I want to implement in some of my Android code.

But does the Dalvik machine for the latest versions of Android

3条回答
  •  春和景丽
    2021-01-12 01:22

    I don't think you can do it now or in near future. As you can see in here Android start listing Java 7 as a requirement since Android 5.0 that was released at Nov 2014.
    That is 3 years after Java 7 first release, so maybe we can use Java 8 from 2017 ;)

    On another note you can use lambda using retrolambda to support lambda in Android dev which is really nice.

提交回复
热议问题