-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#81 top 10 java interview questions i recently faced #130
#81 top 10 java interview questions i recently faced #130
Conversation
@AtlantisLee 麻烦填一下伯乐在线个人主页的地址 |
@hanxiaomax 好的,加上了 |
认领校对 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
麻烦修改一下
你应该知道以下几个重点: | ||
|
||
- **Lambda expressions**, a new language feature, has been introduced in this release. Lambda expressions enable you to treat functionality as a method argument or code as data. Lambda expressions let you express instances of single-method interfaces (referred to as functional interfaces) more compactly. | ||
**lambda 表达式**,Java 8 版本引入的一个新特性。~~lambda 表达式允许你将功能当作方法参数或将代码当作数据~~。lambda 表达式还能让你以更简洁的方式表示只有一个方法的接口 (称为函数式接口) 的实例。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为啥划掉了?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加删除线的都是不太确定的...
**重复注解**支持在同一声明或类型上多次应用同一注解类型。 | ||
|
||
- **Type annotations** provide the ability to apply an annotation anywhere a type is used and not just on a declaration. Used with a pluggable type system, this feature enables improved type checking of your code. | ||
**类型注解**支持在任何使用类型的地方应用注解,而不仅限于声明。~~此特性与可插入型系统一起使用时~~,可增强对代码的类型检查。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里也划掉了
### 为什么 String 对象是不可变的? | ||
|
||
1. [String pool](https://www.journaldev.com/797/what-is-java-string-pool) is possible only because String is immutable in Java. This way, Java Runtime saves a lot of Java heap space, because different String variables can refer to the same String variable in the pool. If String is not immutable, then String interning would not have been possible, because if any variable would have changed the value, it would have been reflected in other variables. | ||
[字符串池](https://www.journaldev.com/797/what-is-java-string-pool)之所以可能,就是因为字符串在 java 中是不可变的。由此 Java 运行时环境节省了大量堆空间,因为不同的 String 变量可以引用池中的同一 String 变量。如果 String 不是不可变的, 则 String 内部操作将是不可能的,因为一旦任一变量更改所引用的String对象的值,它也会反映在其他变量中。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String interning 字符串驻留。要用括号保留英文原文并添加一个wiki或百度的链接
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
(提交翻译请使用下面的模板,其他类型pr请删除)
closes #81
1.译者信息
(请大家一定要填伯乐在线个人主页这一项,方便署名,🙏)
2.疑问区
不确定的地方已经用删除线标记,烦请多多关注
(可在此区域列举有疑问的语句,提示校对人员重点关注)
3.自查表
4.发布信息(译者无需填写)
发布链接:
@hanxiaomax