AnimeSuki Forums

Register Forum Rules FAQ Community Today's Posts Search

Go Back   AnimeSuki Forum > Support > Tech Support

Notices

Reply
 
Thread Tools
Old 2012-01-19, 13:42   Link #1
Witch of Uncertainty
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!
Witch of Uncertainty is offline   Reply With Quote
Old 2012-01-19, 15:53   Link #2
Paranoid Android
Underweight Food Hoarder
 
 
Join Date: Nov 2011
Location: Kitch-Water and T.O., Canada
Age: 32
Send a message via MSN to Paranoid Android
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)
Paranoid Android is offline   Reply With Quote
Old 2012-01-19, 16:09   Link #3
Renegade334
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:
__________________
<< -- Click to enter my (dead) GFX thread.

Last edited by Renegade334; 2012-01-19 at 16:26.
Renegade334 is offline   Reply With Quote
Old 2012-01-19, 21:08   Link #4
larethian
Senior Member
 
 
Join Date: Jul 2010
tl;dr. Even though I've not programmed in years, I worked them out mentally, and my answer is the same as Renegade: 1, 6, 10
larethian is offline   Reply With Quote
Old 2012-01-20, 05:03   Link #5
Witch of Uncertainty
Senior Member
 
 
Join Date: Jun 2010
Thank you SO much
This is really helpful. I managed to get my head around it (FINALLY) now!

Again, thanks. <3
Witch of Uncertainty is offline   Reply With Quote
Reply

Tags
java, programming


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 17:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
We use Silk.