Thread: JAVA if problem
View Single Post
  #2 (permalink)  
Old 07-24-2007, 10:07 PM
cruxblack cruxblack is offline
Senior Member
 
Join Date: Jul 2007
Posts: 130
cruxblack will become famous soon enough
Code:
if (n%2 == 0) return 1; n+test(n%2); else return 0; n+test(n%2);
I haven't tried ur code, but if im not mistaken, if u write return, wouldn't the program got out of the if before it can even do the n+test?
And also, i haven't tried it, but 2 statements that are written in one line are considered 2 statements after all right?
Maybe u should use braces, just for precaution

And btw, if u could maybe post the error message so we can figure whats wrong?
Hope this helps
Reply With Quote