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 Method behaving differently Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic

Method behaving differently

mvPrasad Regula
Ranch Hand

Joined: Sep 14, 2009
Posts: 42
Why is the following code returning zero? If I call giveMeJ() directly in System.out.println, I am getting 10.

Prasad Regula
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63534

Having ignored multiple warnings regarding your display name, your account has been closed.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Method behaving differently
It's not a secret anymore!