File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes another inner class question from K.Mughal. 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 "another inner class question from K.Mughal." Watch "another inner class question from K.Mughal." New topic
Author

another inner class question from K.Mughal.

Minhaj Mehmood
Ranch Hand

Joined: Jan 22, 2007
Posts: 400



Anyone would like to put some light "why its printing "21" instead of "23" (without quotes off course)".


-Minhaj


SCJP6 96% | SCWCD5 81% | SCDJWS5 79%
Raju Champaklal
Ranch Hand

Joined: Dec 10, 2009
Posts: 521
dude because in you are creating a new object of Outer so innercounter will be set to 0 again which will be 1 when a new Inner object is created

i hope this time i am right....right Neha?


scjp 1.6 91%, preparing for scmad
"Time to get MAD now.. we will get even later"....by someone unknown
Neha Daga
Ranch Hand

Joined: Oct 30, 2009
Posts: 504
Yes.


SCJP 1.6 96%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: another inner class question from K.Mughal.