Results 1 to 3 of 3
  1. #1
    javaplus is offline Member
    Join Date
    Nov 2007
    Posts
    97
    Rep Power
    0

    Default Initialize array at runtime

    Just want to know if its possible to initialize array at runtime?

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

    Default

    Yes.
    Java Code:
    class Pseudo {
        int[] sizes;
        String[] ids = new String[0];
    
        // somewhere later
        sizes = new int[16];
        ids = new String[4];

  3. #3
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    javaplus, this is the wrong forum for this post. "Java Tips" forum is not for asking questions. Please be more careful next time..

Similar Threads

  1. How to initialize a two dimensional Array
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-14-2008, 08:48 PM
  2. How to initialize an Array
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-14-2008, 08:47 PM
  3. How to initialize array at runtime
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-09-2007, 03:47 PM
  4. creating array at runtime
    By javaplus in forum New To Java
    Replies: 4
    Last Post: 11-08-2007, 10:06 PM
  5. I do not know how to initialize the two variables
    By Daniel in forum Advanced Java
    Replies: 2
    Last Post: 07-01-2007, 04:42 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
  •