2D Ragged Arrays

Discussion in 'Java' started by Shust, May 1, 2008.

  1. Shust

    Shust

    Joined:
    May 1, 2008
    Messages:
    1
    I'm trying to create a 2D Ragged Array and I want to use initializer lists without them being nested, but for some reason it won't compile.

    I'm attempting:

    char[][] symbols = new char[4][];
    symbols[0] = {'c', 'm', 'j'};
    symbols[1] = {'c', '#', '?', 'w'};
    symbols[2] = {'R'};
    symbols[3] = {'?', '@'};

    First line is okay, but it points me to the first bracket and states:
    illegal start of expression

    Anyone have any suggestions?
    Shust, May 1, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. er
    Replies:
    8
    Views:
    431
    Roland Pibinger
    Jul 5, 2008
  2. Philipp
    Replies:
    21
    Views:
    1,127
    Philipp
    Jan 20, 2009
  3. Mike Robbins

    Ragged Display - Which Control?

    Mike Robbins, Oct 25, 2005, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    162
    Mike Robbins
    Oct 26, 2005
  4. Phlip
    Replies:
    17
    Views:
    233
    Rick DeNatale
    May 18, 2009
  5. Matt
    Replies:
    9
    Views:
    1,158
    Mark Curry
    Feb 10, 2012
Loading...

Share This Page