Support us .Net Basics C# SQL ASP.NET ADO.NET MVC Slides C# Programs Subscribe Buy DVD

Part 17 - C# Tutorial - Method parameters


Part 17 - C# Tutorial - Method parameters


6 comments:

  1. Hi Venkat,
    Why you define Out parameter like this because Ref also can do the same(return multiple values to you)?
    I mean Ref also full fill the same..

    -Sanjay

    ReplyDelete
  2. We need to initialize the variable used in case of Ref but this does not apply for OUT

    ReplyDelete
  3. using System;


    class Program
    {
    public static void main()
    {

    int i = 0;
    simplemethod(i);

    Console.WriteLine(i);
    Console.ReadKey();
    }

    public static void simplemethod(int j)
    {
    j=101;
    }

    }



    the above program ives me error as program does not contains static main method..........plz help

    ReplyDelete
    Replies
    1. Yes, you do not have a "Main" method. Just casing issue.

      Delete
    2. Write main as Main ..Your problem will be solved.

      Delete
  4. Love you Venkat, You're the best

    ReplyDelete

If you like this website, please share with your friends on facebook and Google+ and recommend us on google using the g+1 button on the top right hand corner.