using
System;
namespace
simplecopyconstructor {
class
technicalscripter {
private
string
topic_name;
private
int
article_no;
public
technicalscripter(
string
topic_name,
int
article_no)
{
this
.topic_name = topic_name;
this
.article_no = article_no;
}
public
technicalscripter(technicalscripter tech)
{
topic_name = tech.topic_name;
article_no = tech.article_no;
}
public
string
Data
{
get
{
return
"The name of topic is: "
+ topic_name +
" and number of published article is: "
+
article_no.ToString();
}
}
}
public
class
GFG {
static
public
void
Main()
{
technicalscripter t1 =
new
technicalscripter(
" C# | Copy Constructor"
, 38);
technicalscripter t2 =
new
technicalscripter(t1);
Console.WriteLine(t2.Data);
Console.ReadLine();
}
}
}