Can we use Optionals in Android programming?

前端 未结 3 650
-上瘾入骨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:31

    You can use StreamSupport lib which adds support for the new Streams API and as a side effect it has Optional.

    For gradle use:

    compile "net.sourceforge.streamsupport:streamsupport:1.5.1"
    

提交回复
热议问题