Results 1 to 2 of 2
Thread: return; statement
- 03-16-2012, 10:07 PM #1
Member
- Join Date
- Mar 2012
- Posts
- 2
- Rep Power
- 0
return; statement
So this is how my code goes:
main()
call menu()
menu()
if answer = .....
1stMethod()
if answer = .....
2ndMethod()
1stMethod()
//statements
return; //want to return to the main so it can call menu() again but it just quits the program
2ndMethod()
//statements
return; //want to return to the main so it can call menu() again but it just quits the program
- 03-16-2012, 10:54 PM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
Re: return; statement
It would help if you posted real code and described its output, as well as the output you want. It need not (and probably should not) be your real code - what would help would be a cut down version that just illustrates the logic.
Oracle's Tutorial section on Control Flow Statements may help. But without seeing code, that's just a guess. Also note that, unlike the flow constructs described there, "return" takes you from one method to another, different, one.
Similar Threads
-
Missing return statement
By Aenohe in forum New To JavaReplies: 8Last Post: 03-07-2012, 01:03 PM -
If Statement return
By ricardo5222 in forum New To JavaReplies: 4Last Post: 11-01-2010, 11:43 AM -
Help with Recursion and return statement
By nicolek808 in forum New To JavaReplies: 3Last Post: 09-10-2009, 10:02 AM -
there is no return statement
By gabriel in forum New To JavaReplies: 17Last Post: 12-03-2008, 04:55 PM -
[SOLVED] return statement
By Nakira in forum New To JavaReplies: 8Last Post: 11-12-2008, 11:00 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks