Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
    Bookmark Topic Watch Topic
  • New Topic

I can access private variable??

 
Markandey Sahu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question multiple times. Let's continue the discussion in this duplicate thread, where you have an answer already.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic