Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

object name to string variable  RSS feed

 
aseem agarwal
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i get the name of the object as a string

for e.g there is class student
and object is student s1;

i want s1 as string variable.....
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not Swing related. Moving.
 
aseem agarwal
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you explain what you want to say...
 
Campbell Ritchie
Marshal
Posts: 55797
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only by reflection.
 
Campbell Ritchie
Marshal
Posts: 55797
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aseem agarwal wrote:can you explain what you want to say...
You had posted in the wrong forum.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aseem agarwal wrote:can i get the name of the object as a string

It kind of begs the question of why you want to do this. There are valid reasons for doing this, but sometimes it's a symptom of a broken design.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!