public Sample(string str) : this(int.Parse(str)) { }
public ClassName(string str, int number) : this(str) { }
public Sample(string str) : this(int.Parse(str)) { }
using System;
namespace call_another_constructor
{
class sample
{
public sample()
{
Console.WriteLine("Constructor 1");
}
public sample(int x): this()
{
Console.WriteLine("Constructor 2, value: {0}",x);
}
public sample(int x, int y): this(x)
{
Console.WriteLine("Constructor 3, value1: {0} value2: {1}", x, y);
}
}
class Program
{
static void Main(string[] args)
{
sample s1 = new sample(12, 13);
}
}
}