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. File names get cut with ~1
    By llista in forum Linux - General Topics
    Replies: 1
    Last Post: 08-16-2007, 12:01 PM
  2. Visio's Objects
    By The Donald in forum Windows - General Topics
    Replies: 0
    Last Post: 01-05-2005, 07:28 AM
  3. What are the device names??
    By Compunuts in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 08-24-2002, 05:28 AM
  4. domain names
    By imported_LinuxGuy in forum Linux - General Topics
    Replies: 3
    Last Post: 07-27-2002, 06:11 PM
  5. Reserved names?
    By ndogg in forum Announcements and Suggestions
    Replies: 5
    Last Post: 01-02-2002, 12:59 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
  •