Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

I can access private variable??  RSS feed

 
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: 42972
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.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!