Default parameter in C#

Sourav.Kayal
Posted by Sourav.Kayal under C# category on | Points: 40 | Views : 793
using System;
using System.Linq;
using System.Text;
using System.Collections;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
namespace BlogProject
{
class TestClass
{
public void Print(String name,Int32 Age=25)
{
Console.WriteLine(name);
Console.WriteLine(Age);
}
}

class Program
{
static void Main(string[] args)
{
TestClass t = new TestClass();
t.Print("sourav");
Console.ReadLine();
}
}
}

Comments or Responses

Login to post response