How does Android's Java version relate to a Java SE version?

為{幸葍}努か 提交于 2019-11-26 09:01:59

问题


I am constantly wondering how the Java version used for Android development relates to a Java SE version. For example, I was reading today about \"Type Inference and Generic Methods\" which is a feature added in Java SE 7. I wonder to myself, \"Can I use this in Android code?\"

Of course I could type the code into an Android project and see if it compiles, but I\'d be happier to have some kind of mapping in my head.

I\'ve tried Googling for this info, checking the Android docs, etc, but can\'t find an answer.

Edit: I\'m more interested in language features, e.g. how does the Android Java syntax version relate to Java SE syntax.


回答1:


Android's version doesn't directly relate to Java SE, although it uses a subset of Apache Harmony's SE 6 libraries and tools. It will be up to the Android team to decide if & when to support/require the SE 7 version of Harmony.

Edit It looks like as of KitKat Android supports Java SE 7 language features. See the comments below.



来源:https://stackoverflow.com/questions/7535385/how-does-androids-java-version-relate-to-a-java-se-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!