aspose file tools*
The moose likes Beginning Java and the fly likes Passing String for an object name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Passing String for an object name" Watch "Passing String for an object name" New topic
Author

Passing String for an object name

Joseph Russell
Ranch Hand

Joined: Jan 08, 2001
Posts: 290
Is it possible to do this:

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

Im not certain. The best thing to do when you have questions like this is to just try it. Try replacing
// Other goodies....
with something like this:
foo.add(new java.awt.Button("bar");
and see if you get a compile error.
I might even try it myself


SCJP
Visit my download page
Joseph Russell
Ranch Hand

Joined: Jan 08, 2001
Posts: 290
I was getting an error. I think my problem was that I was attempting to name my object from an instance variable inside the method.
Joe
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing String for an object name