To create a instance of class in c#

Jitendrasoft09
Posted by Jitendrasoft09 under C# category on | Points: 40 | Views : 805
using System;

class Product {
public int num = 121;
public string Name = "Jitendra";
}


class JkExample {

public static void Main(string[] args) {

Product p = new Product();
Console.WriteLine(p.num);
Console.WriteLine(p.Name);

Console.ReadLine();
}
}

Comments or Responses

Login to post response