aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Plz xplain this code segment for me Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Plz xplain this code segment for me" Watch "Plz xplain this code segment for me" New topic
Author

Plz xplain this code segment for me

Kirby Cheung
Greenhorn

Joined: Nov 04, 2005
Posts: 3
public class Inc{
public static void main(String argv[]){
Inc inc = new Inc();
int i =0;
inc.fermin(i);
i = i++;
System.out.println(i);
}
void fermin(int i){
i++;
}
}

"i=i++" is weird.
How the compiler deals with it?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Kirby Zh:
..."i=i++" is weird. How the compiler deals with it?

Welcome to JavaRanch!

You will probably find The Java Tutorial to be a very helpful resource.

In particular, Arithmetic Operators (at the bottom of the page).

Or, for more details, this section of Thinking in Java.

Post again if this doesn't clear it up.
[ November 04, 2005: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Kirby Cheung
Greenhorn

Joined: Nov 04, 2005
Posts: 3
You are so warm-hearted.
Thanks a lot
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Plz xplain this code segment for me
 
Similar Threads
i=i++?
What is the output
simple one but Tricky !!
why output 0 for this question?
doubt pass by copy