Results 1 to 2 of 2

Thread: Objects with diffrennt names

  1. #1

    Objects with diffrennt names

    Anyone know the best way to create multiple objects of the same class with different data and names using a loop in Java?

    Here is psuedocode for what I mean

    Code:
    for(x = 1; Line > x; x++) {
      host host + x = new host(somarray[x]);
      ...
    }

  2. #2

    Re:Objects with diffrennt names

    [quote author=Ashcrow link=board=9;threadid=7723;start=0#msg70526 date=1063417661]
    Anyone know the best way to create multiple objects of the same class with different data and names using a loop in Java?

    Here is psuedocode for what I mean

    Code:
    for(x = 1; Line > x; x++) {
      host host + x = new host(somarray[x]);
      ...
    }
    [/quote]

    i think you could do it if you use an array rather than just host + x, like:

    host host[x] = new host(somarray[x]);

    because in most languages you can't declare variable names from variables (and when you can it can get screwy).

Similar Threads

  1. Visio's Objects
    By The Donald in forum Windows - General Topics
    Replies: 0
    Last Post: 01-05-2005, 07:28 AM
  2. Setting Up Pages in Visio
    By The Donald in forum Windows - General Topics
    Replies: 0
    Last Post: 01-05-2005, 07:25 AM
  3. Active Directory LDAP Compliance
    By regix in forum Windows - General Topics
    Replies: 0
    Last Post: 01-04-2005, 03:34 AM
  4. New Features that are included in Access 2000
    By regix in forum Windows - General Topics
    Replies: 0
    Last Post: 01-01-2005, 03:17 AM
  5. GL not working ati 7000
    By Mip in forum Linux - Software, Applications & Programming
    Replies: 19
    Last Post: 10-28-2004, 09:29 PM

Bookmarks

Posting Permissions

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