How to access private variables

android

Solution

use getters and setters ..it is the preferred way.. in setters make sure you keep safe values and make sure they will not break your code in any case..

Problem

Is there any way to access private variables of other class.Actually I am writing testCases for my library project in order to test all possible critical conditions when the app is going to crash .I shuld write in such a way that my project should pass all test cases.Now what my problem I should check for the variables which are declared as private in my library project.Is there any way to access these variables (which are declared as private).

Original source