Initialize 2D array

前端 未结 5 926
我寻月下人不归
我寻月下人不归 2020-12-02 16:33

I am trying to initialize a 2D array, in which the type of each element is char. So far, I can only initialize this array in the follow way.



        
5条回答
  •  孤城傲影
    2020-12-02 17:13

    Easy to read/type.

      table = new char[][] {
          "0123456789".toCharArray()
        , "abcdefghij".toCharArray()
      };
    

提交回复
热议问题