Declaring an array of objects

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vishnu53
    New Member
    • Oct 2007
    • 1

    #1

    Declaring an array of objects

    how to declare array of objects to a class??
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by vishnu53
    how to declare array of objects to a class??
    [code=java]
    T[] array;
    [/code]

    This defines, but doesn't intantiate yet, an array of objects of type T.

    kind regards,

    Jos

    Comment

    • JosAH
      Recognized Expert MVP
      • Mar 2007
      • 11453

      #3
      I just deleted your other identical thread; please don't open multiple threads on the same topic.

      kind regards,

      Jos

      Comment

      • Ozzi
        New Member
        • Oct 2007
        • 4

        #4
        Object[] myObjectArray = new Object[n];

        where n is the number of elements of the array.

        Comment

        Working...