aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Different output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Different output" Watch "Different output" New topic
Author

Different output

Ravi Ahuja
Ranch Hand

Joined: Nov 13, 2006
Posts: 45

[op]
The output from the following code is
10
10
11
[/op]
[trick]
The Doubt starts here:
When same code is run in c++ it gives the output as
10
11
12 respectively
Any thoughts ?
[/trick]


Impossible is Nothing<br />SCJP 1.4: 96%
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Please search this forum, or our FAQ, for the many previous discussions about this topic. And please forget c++, which is not relevant to this forum.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Burkhard Hassel
Ranch Hand

Joined: Aug 25, 2006
Posts: 1274
Hi Ravi,

look at this:
http://faq.javaranch.com/view?PostIncrementOperatorAndAssignment

Barry Gaunt posted November 17, 2006 02:47 PM
And please forget c++, which is not relevant to this forum.

Maybe as a variation:


prints CCD


Yours,
Bu.


all events occur in real time
Ravi Ahuja
Ranch Hand

Joined: Nov 13, 2006
Posts: 45
Burkhard Hassel
Ranch Hand

Joined: Aug 25, 2006
Posts: 1274
Hi ranchers,

Ravi Ahuja posted November 18, 2006 05:20 AM
code:

i know its irrelevant anyways i thought someone could have helped me anyways forget it


It's not irrelevant, and I found a link for you that should clear the output.
I put the same link here a second time again, perhaps you read it now.

---> http://faq.javaranch.com/view?PostIncrementOperatorAndAssignment


Bu.
Ravi Ahuja
Ranch Hand

Joined: Nov 13, 2006
Posts: 45
[c]
Thanks Everyone
[/c]
Franz Fountain
Ranch Hand

Joined: Nov 15, 2006
Posts: 58
For this particular forum, I think dialog is important even if it seems like we may be repeating the same conversation. I think dialog is an important part of the learning process. I don't think it's sufficient in this forum to simply say "search the forum for previous answers". I think a lot of learning goes into just forming a question and writing it in your own in your own words.

For example, I suppose if you teach the same class for years you get the same questions over and over. That's ok. That's the reason that someone takes the class so that they can get the opportunity to asks questions on a subject that is new to them. Remember it may be old news to some of you ranch hands and more experienced cowpoke, but it may be new news to the greenhorns. And remember this is a "friendly place for Java greenhorns".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Different output
 
Similar Threads
Increment and Decrement Operators
difficulty in understanding backslash?
Any body explanation why ...
Bitwise operator precedence
Post increment and Pre Increment Precedence