Skip to content
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

2020-01-08:请说说Java中String.length()的运作原理? #229

Open
Moosphan opened this issue Jan 8, 2020 · 6 comments
Open

2020-01-08:请说说Java中String.length()的运作原理? #229

Moosphan opened this issue Jan 8, 2020 · 6 comments

Comments

@Moosphan
Copy link
Owner

Moosphan commented Jan 8, 2020

No description provided.

@haigendong
Copy link

char array 的长度?不会,来凑个热闹。。

@juicelover
Copy link

private final char value[];

public String(char value[]) {
this.value = Arrays.copyOf(value, value.length);
}

public int length() {
return value.length;
}

@THEONE10211024
Copy link

mark

@FirewingsR
Copy link

return value.length

@auxor
Copy link

auxor commented Sep 15, 2020

https://colobu.com/2019/01/04/how-many-charactors-in-a-java-string/

@zoomc
Copy link

zoomc commented Jul 28, 2021

这问题太无聊了,有时间研究这个,不如学学新技术

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants