using System;
class out_demo
{
public void add(out int num)
{
num=90; //set the value in reference of num
}
public static void Main()
{
int num; //local variable but not initialized
out_demo obj=new out_demo();
obj.add(out num);
Console.WriteLine(num);
}
}
//output will be
//90
//now we can say that in case of out parameter value transfered out from the method named add()
About Me
Saturday, December 19, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment