Results 1 to 5 of 5
Thread: Jumping in java
- 03-25-2012, 01:07 PM #1
Member
- Join Date
- Mar 2012
- Posts
- 10
- Rep Power
- 0
- 03-25-2012, 01:18 PM #2
Re: Jumping in java
yes with the keywords break and continue. years of experience with basic have shown that GOTO should be handled carefully
- 03-25-2012, 01:25 PM #3
Member
- Join Date
- Mar 2012
- Posts
- 10
- Rep Power
- 0
Re: Jumping in java
Thank you!!
but is this allowed-
int i= 2;
start :
System.out.println(i);
i+=2;
if(i<51) goto start:
I mean iteration without any looping construct ??
- 03-25-2012, 01:27 PM #4
Senior Member
- Join Date
- Sep 2008
- Location
- Stockholm, Sweden
- Posts
- 119
- Rep Power
- 0
Re: Jumping in java
What happened when you tried it?
- 03-25-2012, 01:36 PM #5
Re: Jumping in java
will not compile, goto is a keyword but is not used in java, so the compiler will not know what to do. for such problems you can use a while-, do-while or a for-loop.
Similar Threads
-
My code was not executed properly.It will jumping to exception handling.my code is
By vinay4051 in forum EclipseReplies: 3Last Post: 08-10-2011, 10:17 AM -
Help with jumping
By shadycharacter in forum New To JavaReplies: 1Last Post: 04-14-2010, 10:04 PM -
How to stop thread from being jumping off the code without executing it.....
By chiragkini in forum Threads and SynchronizationReplies: 6Last Post: 01-22-2009, 04:38 AM -
Eclipse - jumping to method definition
By Java Tip in forum Java TipReplies: 0Last Post: 11-07-2007, 03:52 PM
Bookmarks