是否可以使用许多简单的数组值来声明为多维数组值?
char[] alpha1 = {"A","B","C","D","E"};
char[] alpha2 = {"F","G","H","I","J"};
//Is it possible? Give me a solution for this situation:
char[][] alpha = { alpha1[] , alpha2[] };
答案 0 :(得分:3)
使用" "
声明一个String。使用' '
作为角色。
但是有可能,但您必须删除[]
:
char[] alpha1 = {'A','B','C','D','E'};
char[] alpha2 = {'F','G','H','I','J'};
char[][] alpha = { alpha1 , alpha2 };
答案 1 :(得分:0)
有几种方法可以声明多维数组: