是什么在Android Studio中0.3.2的语言级别设置做什么? [英] What does the language level setting in android studio 0.3.2 Do?

查看:206
本文介绍了是什么在Android Studio中0.3.2的语言级别设置做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android Studio中的最新版本(0.4.2),创建一个新的项目,即语言水平
我想知道什么是指,并选择任何提供的选项的结果。
该文档不给我这样一个清晰的画面,我不希望选择时,我不知道是什么,这将导致一个选择吗?
谢谢

In the latest release of Android Studio (0.4.2), a new setting has been added when creating a new project, namely Language Level I want to know what that refers to, and the consequence of selecting any of the provided options. The doc doesn't give me a clear picture of this and i don't want to select an option when i don't know what that will result in? Thanks

推荐答案

这是什么,你要使用Java语言水平。奇巧支持完整的Java 7,姜饼和最多支持Java 6和旧版本是Java 5,当它涉及到核心的Java API最少。大致相同的设置中提到的这里

It's about what Java language level you want to use. KitKat supports full Java 7, Gingerbread and up support Java 6 and older versions are Java 5. At least when it comes to the core Java APIs. Roughly the same setting is mentioned here.

您可以经常使用的一个版本中添加的是旧版本,如果编译器知道如何做到这一点的语言功能。例如在<一href=\"http://stackoverflow.com/questions/4166966/what-is-the-point-of-the-diamond-operator-in-java-7\">Diamond在Java 7中添加操作,但你仍然可以使用该功能的Java 6中,因为

You can often use language features that were added in one version in an older version if the compiler knows how to do it. For example the Diamond Operator was added in Java 7 but you can still use that feature in Java 6 since

List<String> list = new ArrayList<>();

实际上编译成同样的事情

actually compiles into the same thing as

List<String> list = new ArrayList<String>();

做到了。

的构造,另一方面以资源尝试不能被编译成合法的Java 6兼容code,因此独家应用程序需要奇巧以上。

The "try with resource" construct on the other hand can't be compiled into legal Java 6 compatible code and is therefore exclusive to Apps that require KitKat and up.

这篇关于是什么在Android Studio中0.3.2的语言级别设置做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆