Results 1 to 2 of 2
  1. #1
    colerelm is offline Member
    Join Date
    Apr 2011
    Posts
    7
    Rep Power
    0

    Default Creating an array of generic type

    How would I make an array of type generic? I've tried doing this so far:

    Java Code:
    T[] tempArray = (T[]) new Object[];

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

Similar Threads

  1. Type wildcards in Generic
    By gvm in forum New To Java
    Replies: 1
    Last Post: 10-22-2010, 04:39 PM
  2. Generic return type is not inferred in for-each loop
    By ranma173 in forum Advanced Java
    Replies: 5
    Last Post: 10-08-2010, 11:50 AM
  3. Generic collection type
    By dreuzel in forum Advanced Java
    Replies: 7
    Last Post: 12-23-2009, 06:05 PM
  4. Replies: 1
    Last Post: 05-16-2008, 11:06 PM
  5. Need help with creating array of type object
    By riz618 in forum New To Java
    Replies: 3
    Last Post: 01-29-2008, 06:14 AM

Posting Permissions

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