using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
public class student
{
public int a, b;
public student(int x, int y)
{
a = x;
b = y;
}
public student(student n)
{
a = n.a;
b = n.b;
}
public void showdata()
{
Console.Write("a=" + a);
Console.Write("b=" + b);
}
}
static void Main(string[] args)
{
student s1 = new student(2,3);
student s2 = new student(s1);
s1.showdata();
s2.showdata();
Console.ReadKey();
}
}
}
/*Do leave a comment if you find this useful*/
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
public class student
{
public int a, b;
public student(int x, int y)
{
a = x;
b = y;
}
public student(student n)
{
a = n.a;
b = n.b;
}
public void showdata()
{
Console.Write("a=" + a);
Console.Write("b=" + b);
}
}
static void Main(string[] args)
{
student s1 = new student(2,3);
student s2 = new student(s1);
s1.showdata();
s2.showdata();
Console.ReadKey();
}
}
}
/*Do leave a comment if you find this useful*/
No comments:
Post a Comment