Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   Implicit returns (http://www.programmingforums.org/showthread.php?t=15776)

secrecy230 May 5th, 2008 1:35 AM

Implicit returns
 
Hi all,
I have an assignment to do and as specification it said:
Your parser should determine the number of returns per method and the return type for each method in the class file. These should be printed in a table. Be sure to count implicit returns.

My question are:
What is implicit return ?
Can you give me an example?

Wizard1988 May 5th, 2008 1:41 AM

Re: Implicit returns
 
I am not 100% sure but here is what I think it is:

:

void foo()
{
  doSomething()
}

int bar(int a)
{
 return a *a
}

int main()
{
  foo();
  bar(2);
  return 0;
}

In the above example I think it could be said that foo() has an implicit return. After execution of doSomething() completes foo() "returns" to main and bar() is called. Hopefully this helps.


All times are GMT -5. The time now is 9:54 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC