View RSS Feed

Recent Blogs Posts

  1. Returning a Value from a Method

    by , 04-26-2012 at 05:36 PM
    To the code, a method is returned which invokes it, when:

    • In method, all statements are completed.
    • reaches to the a return statement or
    • an exception is thrown (covered later)

    Which ever would come first?

    Return type of the method is declared in the method declaration. Within methodís body, return statement is used so that to return value.

    Method which has been declared void will not return value. Return statement is not need ...