Posted by : Sudhir Chekuri Thursday, 31 December 2015

It is one of the method that doesn't have any arguments/parameters. It contains only return type.

Example

public int add()

{

Console.WriteLine("addition");

return 1;

}

A method can return value to anything which is capable of holding that value.

Example


int i=add();

Console.WriteLine(i);//1

Explanation

In the above example the add method can return value'1' to i and it will be printed as output.

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Followers

Total Pageviews

Powered by Blogger.

Blog Archive

- Copyright © 2013 DevStudent - Metrominimalist - Powered by Blogger - Designed by Johanes Djogan -