java array

you can't initialize array like this way:
public static final String dic[4] = {"33","3","4","5"};
I don't know why you can't assign the length of the array if you want initialize like this
below is correct:
public static final String dic[] = {"33","3","4","5"};

int a[]={33,3,4,5};//declaration, instantiation and initialization

you can print the array like this for loop
for(String str : dic){

}

posted @ 2022-07-01 20:55  奋斗中的菲比  阅读(23)  评论(0编辑  收藏  举报