• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access value of the private variable outside the class?

 
Hrishikesh Ghatnekar
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you help in finding the answer for following?

1)Is there any way in java to access the value of the private variable outside the class?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Have a search through these forums, you'll find the answer.
 
Bob Good
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use reflection, see here:

http://forum.java.sun.com/thread.jspa?threadID=426309&messageID=1897216

You may want to use Apache commons beanutils, see here:

http://commons.apache.org/beanutils/

Bob
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic