Using the this Object Reference : This : Class Interface C# Source Code


Custom Search

C# Source Code » Class Interface » This »

 

Using the this Object Reference








    
 

public class Product {

    public int yearBuilt;

    public void SetYearBuilt(int yearBuilt) {
        this.yearBuilt = yearBuilt;
    }
}
class MainClass{

    public static void Main() {
        Product myProduct = new Product();

        myProduct.SetYearBuilt(2000);
        System.Console.WriteLine("myProduct.yearBuilt = " + myProduct.yearBuilt);
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Class Interface
» This