as I put within an array another array?

as I put within an array another array?

String a[]={"hi","LOl"};
String b[]={"1","2"};

  myListArray[]  ={   a,b     };

Answers

  • Answer ✓

    Processing comes w/ some array functions. In your case, you gotta use concat():
    http://processing.org/reference/concat_.html

  • The {} init syntax works only where you declare the array:

    String[] a = {"hi","LOl"};
    String[] b = {"1","2"};
    
    String[] myListArray[]  ={   a,b     };
    

    Notice I have put the [] after the type, not the variable. The second syntax is tolerated to please people coming from the C/C++ world, but the first one is preferred.

    I supposed you want to make an array of arrays, GoToLoop supposed you want to concatenate them (put all the content of both arrays in the same one. Perhaps you want to clarify...

Sign In or Register to comment.