File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes I can access private variable?? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply locked New topic
Author

I can access private variable??

Markandey Sahu
Greenhorn

Joined: Jun 29, 2006
Posts: 13
hi all,
I can access the private variable. how?? i am showing now
write these two class and compile and run
1st class file name:MyClass.java

2nd class file name: Test.java

now be careful compile only MyClass.java file not the Test.java file
after compilation run Test class using command (java Test)

now you will get output:
my private variable
MyClass private method

Note: Please run the following application in your console
don't use any editor .. eclipse or other else

if you get reason for this behavior pls answer me
thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35232
    
    7
Please do not post the same question multiple times. Let's continue the discussion in this duplicate thread, where you have an answer already.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: I can access private variable??
 
Similar Threads
I can access private variable?? pl give me reason..
Top Level Class doubt
private final method
When do we need to declare a class as public?
Please Help !!! (package and accessibility)