Results 1 to 5 of 5
Thread: where is 6 coming from
- 10-16-2011, 02:33 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 18
- Rep Power
- 0
where is 6 coming from
when i run this code, i get 6 and 7. Where is 6 coming from?
tks
public class Ouch {
static int ouch = 7;
public static void main(String[] args) {
new Ouch().go(ouch);
System.out.print(" " + ouch);
}
void go(int ouch) {
ouch++;
for (ouch = 3; ouch < 6; ouch++)
;
System.out.print(" " + ouch);
}
}
- 10-16-2011, 02:35 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
Re: where is 6 coming from
for (ouch = 3; ouch < 6; ouch++)
;
System.out.print(" " + ouch);
- 10-16-2011, 02:38 PM #3
Member
- Join Date
- Jan 2011
- Posts
- 18
- Rep Power
- 0
- 10-16-2011, 02:44 PM #4
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
Re: where is 6 coming from
yes but the loop runs still couch(local couch) is less than 6 (after the loop couch(local) is 6!)
- 10-16-2011, 02:48 PM #5
Member
- Join Date
- Jan 2011
- Posts
- 18
- Rep Power
- 0
Similar Threads
-
i cant undersatand y this error is coming
By RajeshReddy in forum AWT / SwingReplies: 0Last Post: 07-21-2011, 02:53 PM -
Jax is coming to the us!!!
By blease87 in forum Reviews / AdvertisingReplies: 0Last Post: 03-04-2011, 12:21 PM -
Please help output not coming
By majin_harish in forum New To JavaReplies: 2Last Post: 02-05-2009, 09:45 AM -
Why is the answer not coming out
By anonymous18 in forum New To JavaReplies: 4Last Post: 11-12-2008, 03:10 AM -
How can i know from which jsp request is coming?
By vishnujava in forum Java ServletReplies: 1Last Post: 08-06-2008, 01:13 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks