Results 1 to 4 of 4
  1. #1
    M77's Avatar
    M77
    M77 is offline Member
    Join Date
    May 2008
    Location
    LV
    Posts
    43
    Rep Power
    0

    Default 2D Array Initialization

    Set<Obj>[][] map=new Set<Obj>[20][20];

    compiler: generic array creation

    What's wrong?

  2. #2
    Zosden's Avatar
    Zosden is offline Senior Member
    Join Date
    Apr 2008
    Posts
    384
    Rep Power
    10

    Default

    You cant use generics with an array because you can only have one object in an array.
    My IP address is 127.0.0.1

  3. #3
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    10

    Default

    You may use Hashmap<K,V> instead of that kind of implementation....
    freedom exists in the world of ideas

  4. #4
    M77's Avatar
    M77
    M77 is offline Member
    Join Date
    May 2008
    Location
    LV
    Posts
    43
    Rep Power
    0

Similar Threads

  1. variable initialization
    By rqal.10 in forum New To Java
    Replies: 5
    Last Post: 06-15-2008, 06:39 AM
  2. initialization value problem
    By ravian in forum New To Java
    Replies: 2
    Last Post: 01-28-2008, 11:54 AM
  3. Icon initialization problem
    By saz25 in forum AWT / Swing
    Replies: 1
    Last Post: 12-24-2007, 11:37 PM
  4. Lazy Initialization
    By onegcr in forum New To Java
    Replies: 1
    Last Post: 08-14-2007, 03:29 PM
  5. log4j initialization
    By arfatkhan in forum Web Frameworks
    Replies: 3
    Last Post: 08-10-2007, 07:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •