Originally posted by Sahir Shah:
Narayana Murthy,
Sorry. I might have misunderstood your question. The above post contains instructions on fooling the compiler. About what is
actually happening here. Well I dont know the full story yet. Apparently access modifiers are only checked at compile time in certain cases. So after you compile the caller class if the called class has been modified and the access modifier is now private the run time system ignores it. It isnt working with the java native classes right now. But it is worth a try.
Rgds
Sahir
Originally posted by Sahir Shah:
Narayana Murthy,
Use the same method you use for creating your own packages eg:- package com.yourname.packagename;
For details refer to Bruce Eckels TIJ or
Patrick Naughton's The Complete Java Reference ( Chapter 9. Packages and Interfaces. Section - Understanding CLASSPATH.)
Asim Wagan,
I am not ready yet to post the code because I am not able to conclusively prove that you can get at the foundation classes private members. All I have managed so far is to fool the compiler. It has to run successfully and bushwhack one of the core classes. If I manage to do that I shall certainly post it here. If any of you guys have any suggestions please post it here. Many heads are better than one.
Rgds
Sahir
[This message has been edited by Sahir Shah (edited November 17, 2000).]