Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

toArray() of ArrayList<String>

843793Jul 18 2004 — edited Jul 18 2004
   ArrayList<String> relNames;

   public String[] getRelNames()
   {
      if (database == null)
         throw new Error("No database is connected.");
     else
        return relNames.toArray();
   }
the code above wont compile because relNames.toArray(); returns Object[], but i ve specified in the declaration that ArrayList<String> relNames; dont quite understand why?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 15 2004
Added on Jul 18 2004
2 comments
125 views