Manwarjit Singh

Greenhorn
+ Follow
since Jan 08, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Manwarjit Singh

Hey I'm from mumbai and wanna appear for exam in early march .
Lookin forward for ur coporation.
Mail me at - manwar_jit@yahoo.com

Originally posted by Manfred Leonhardt:
[B]Hi Manwarjit,
It seems you still don't get it. My answer for i = i++ + i++ is correct. I even showed you step by step how it works! The program below will prove me right!

Sorry, I was calculating with i = 1 , But urs is with i = 0;
Its altright, I withdrew my comment.
correct this time,
Manfred.[/B]


Thanks Wasim, Jane
Similarly we can do for post/pre, increment/decrement :-
Here is the example :-
_____________________________________________
public class M{

public static void main(String args[])
{
int i=1;
i = i++ + ++i + i + --i + i--;

// i = 1(2) + (3)3 + 3 + (2)2 + 2(1)
// now remove all non-barckets .
// So we get
// i = 1+3+3+2+2
// i = 11;

System.out.println(i);
}
}
_____________________________________________
Output is 11.
[This message has been edited by Manwarjit Singh (edited February 16, 2001).]
Thanks Manfred for clearing my dbout.
[This message has been edited by Manwarjit Singh (edited February 16, 2001).]
[This message has been edited by Manwarjit Singh (edited February 16, 2001).]
Hi,
I am giving SCJP2 exam in end of feb.
Please contact me at...........

javasingh@chequemail.com
HI,
In following code, Why does't value of i get incremented :
_______________________________________________
public static void main(String args[])
{
int i=9;
i=i++;
System.out.println(i);
}
}
_______________________________________________
output is : 9
Where as it should be 10.
-Thanks-