Wednesday 22 August 2012

c# .net class with constructor

c# .net |  namespace and class with constructor | code source | program | output | comments
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace constatnt
{
class Program // class  name program
{
int i;
float j;

public Program(int x, float z) // constructor  declared as public
{
i = x;
j = z;
}


public void display()
{
Console.Write("roll  number"+i+"\n"+"salary ="+j+"rs");
}

static void Main(string[] args  ) // main of the program
{
Program p = new Program(10, 3.4f);
p.display();

}
}
}

/*output


//program c# .net |  namespace and class with constructor | code source | program | output | comments//
roll number =10
salary =3.4 rs
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: