aspose file tools
The moose likes Java in General and the fly likes Access value of the private variable outside the class? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Access value of the private variable outside the class?" Watch "Access value of the private variable outside the class?" New topic
Author

Access value of the private variable outside the class?

Hrishikesh Ghatnekar
Greenhorn

Joined: Oct 25, 2004
Posts: 28
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

Joined: Apr 14, 2004
Posts: 10336

Yes. Have a search through these forums, you'll find the answer.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Bob Good
Ranch Hand

Joined: Jan 09, 2008
Posts: 86
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Access value of the private variable outside the class?
 
Similar Threads
package problem
Inheritance problem
How to access private static variables outside the class?
private member doubt
How to know a variable is accessed?