A friendly place for programming greenhorns!
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)
Author
Plz xplain this code segment for me
Kirby Cheung
Greenhorn
Joined: Nov 04, 2005
Posts: 3
posted
Nov 04, 2005 19:14:00
0
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
I like...
posted
Nov 04, 2005 19:51:00
0
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
posted
Nov 04, 2005 20:57:00
0
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
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter