2012-01-19, 13:42 | Link #1 |
Senior Member
Join Date: Jun 2010
|
Programming (Java)
Sorry if this is completely misplaced, but I'm having a LOT of trouble over a task we got in Java, and I'm wondering whether anyone here oculd help me out?
So basically, my brain is crying over this: Explain what results you get, and why you get them: Spoiler for :|:
Can anyone help? I would reaaallly appreciate it. This subject is driving me insane! |
2012-01-19, 15:53 | Link #2 |
Underweight Food Hoarder
|
What is '++x'
in z=A(++x,B(x,y)); ? I've never seen such an value being passed as an argument. I've only used it as a built in increment method. My current workstation doens't have java so i just just did this on paper: -4 1 -4 (if I ignore that ++ argument) |
2012-01-19, 16:09 | Link #3 |
Sleepy Lurker
Graphic Designer
Join Date: Jul 2006
Location: Nun'yabiznehz
Age: 38
|
Did it first by hand, got confused with all the reused variables then ended up using Eclipse as assistant, but still had to tear everything apart.
Anyway, here's how it's executed: Spoiler:
And the ++ before the variable indicates a preincrementation. The difference between ++var and var++ is this: Spoiler:
__________________
Last edited by Renegade334; 2012-01-19 at 16:26. |
Tags |
java, programming |
|
|