Creating an object during runtime



I'm trying to generate an object name during run time, and then create an
object with the contents of that variable. You can see that I'm trying to
also make the object name self generating (almost, the 'y' variable isnt
being incremented yet), putting two values ('y' and 'C'). My apologies for
poor coding structure / lack of comments, but I'm am a bit lost on how to
work it out. MANY thanks in advance.Heres what I have so far:

public class testVariable
{
private String name = "";
private String New_name = "";
private int y = 2;

public testVariable()
{}

public void test(String x)
{
name = x;
New_name = name + y ;
System.out.println(New_name);
}

public String getNew_name()
{
return New_name;
}



public static void main(String[] args)
{
int z = 2;
testVariable Darren = new testVariable();
Darren.test("C");
testVariable "c"+ z = new testVariable();
String Old_name = New_name;
}
}


.



Relevant Pages

  • Re: Creating an object during runtime
    ... My apologies for poor coding structure / lack of comments, ... > I'm am a bit lost on how to work it out. ... Please don't start variable names with a capital letter. ...
    (comp.lang.java.programmer)
  • Re: ot-letter from a marine
    ... Dang, Google seems to have lost my reply.I'll try to duplicate it, ... However, by your definition, you just lost. ... Ahh, my apologies then. ... save more soldiers lives than your efforts did. ...
    (rec.martial-arts)
  • Re: how to get the file name
    ... see it in the filesystem, so whatever changes I make to ... the file will be lost as soon as I close it. ... It's a different file with a different inode. ... Prev by Date: ...
    (comp.os.linux.development.apps)
  • Does using index.php affect search engine rankings?
    ... Apologies if this is the wrong group ... TIA ... Dynamo ... Prev by Date: ...
    (comp.lang.php)
  • RE: Word for windows dropped off my pc suddenly, how do I get it back?
    ... I dont want to have to pay for a new download when I ... > already have it but just seemed to have lost it entirely in my computer? ... Prev by Date: ...
    (microsoft.public.word.docmanagement)