Wednesday, 1 January 2014

Lamda And Enum Example Tutorial For Beginners

Lamda And Enum Example Tutorial For Beginners



   //Lamda Expression//
        public delegate int calc(int la);

 private void lamdabtn_Click(object sender, EventArgs e)
        {
            //Lamda
            mob la = l => l * l * l;
            label7.Text = la(6).ToString();
            //---------------------------//
        }

  //Enum//
  enum em { mon, tue, wed, thurs, fri = 50, sat, sun };
  

        private void Enumbtn_Click(object sender, EventArgs e)
        {
            enumlabel1.Text = em.fri.ToString();

            int x = (int)em.fri;
            enumlabel2.Text = x.ToString();
        }

No comments:

Post a Comment