File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Private modifier problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Private modifier problem" Watch "Private modifier problem" New topic

Private modifier problem

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634


i think output should be

as we are changing the value in the changeValmethod to 2

OCPJP 6.0 93%
OCPJWCD 5.0 98%
Prasad Kharkar
Ranch Hand

Joined: Mar 07, 2010
Posts: 446

just change the statement


this should solve the problem

SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right
Ankit Garg

Joined: Aug 03, 2008
Posts: 9465

This statement has no effect. It will assign the value of the same variable to itself i.e. the parameter received by the method. You can think of the code as this

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: Private modifier problem
It's not a secret anymore!