Posts

collection classes in C#

Image
    For Example: Write a program to demonstrate the use collection classes. using System; using System.Collections; using System.Linq; using System.Text;   namespace ConsoleApplication12 {     class Program     {         static void Swap<T>(ref T lhs, ref T rhs)         {             T temp;             temp = lhs;             lhs = rhs;             rhs = temp;         }         static void Main(string[] args)         {             int a, b;   ...

use of custom generic class in C#

Image
  For Example: Write a program to use of custom generic class. using System; using System.Collections; using System.Linq; using System.Text;   namespace ConsoleApplication12 {     //Generic Class     class GenericClass<MyType>     {         //Private Fields         private MyType A, B;         //Parameterized Constructor         public GenericClass(MyType x, MyType y)         {             A = x;             B = y;         }         public void Print()         {       ...

queue in C# Programming

Image
  For Example: Write a program to demonstrate the use of queue using windows Form Application. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Collections; namespace form {     public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();         }           private void button1_Click_Click(object sender, EventArgs e)         {             Queue days = new Queue();             da...