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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
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://aspose.com/file-tools
 
subject: Access value of the private variable outside the class?
 
Similar Threads
How to know a variable is accessed?
private member doubt
package problem
How to access private static variables outside the class?
Inheritance problem