Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 44760d4

Browse files
author
sunwne
committed
在java中声明数组
1 parent 1000ff2 commit 44760d4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

‎contents/Declare-array-in-Java.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
##在java中声明数组
2+
3+
###问题描述:
4+
你是如何在jva中声明数组的。
5+
6+
你可以进行用数组声明或者数组常量(注意:当你声明或者立即影响了变量,数组常量将不能再用来分配一个数组)
7+
对于原始类型:
8+
```
9+
int[] myIntArray = new int[3];
10+
int[] myIntArray = {1, 2, 3};
11+
int[] myIntArray = new int[]{1, 2, 3};
12+
```
13+
杜宇类,比如String类,也是相同的:
14+
```
15+
String[] myStringArray = new String[3];
16+
String[] myStringArray = {"a", "b","c"};
17+
String[] myStringArray = new String[]("a", "b", "c");
18+
```
19+
[stack overflow链接:Declare array in Java?](http://stackoverflow.com/questions/1200621/declare-array-in-java#)
20+
21+
22+
23+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /