Class Members in C#



Fields and methods inside classes are often referred to as "Class Members"

Create an ExampleOne class with three class members: two fields and one method
  1. class ExampleOne  
  2. {  
  3.   // Class members  
  4.   string col = "green";        // field  
  5.   int maxValue = 200;          // field  
  6.   public void PrintString()   // method  
  7.   {  
  8.     Console.WriteLine("Hello, I am rajan singh");  
  9.   }  
  10. }  

0 Comment's

Comment Form