Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# base vs this

// The 'this' keyword represents the current class instance.
// While 'base' access's a method on the parent.

// Example of usage:
public class Parent
{
    public virtual void Foo() {}
}

public class Child : Parent // Derive from 'Parent' class
{
    public override void Foo()
    { base.Foo(); } // call the virtual method on 'Parent'

	// The override is basically not doing anything in this case, since we do
	// exactly the same thig as in the parent method (which in this case is nothing).
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# wpf control to windw size 
Csharp :: entity framework linq join 2 tables c# 
Csharp :: Make Enemy follow and rotate towards target in Unity 
Csharp :: parent to children nextJs 
Csharp :: C# dest 
Csharp :: how to extract data from a document using c# 
Csharp :: copy file image in c# 
Csharp :: serach a keyword in whole database 
Csharp :: how to fill dictionary in c# 
Csharp :: c# max in 2d array row 
Csharp :: whining 
Csharp :: c# does readonly improve performance 
Csharp :: C# How to implement IEnumerable<T interface 
Csharp :: c# show existing form 
Csharp :: .net framework method 
Csharp :: unity soundclip mix 
Csharp :: convert a string to an integer without using library 
Csharp :: ExpandoObject Convert to Json or Json to ExpandoObject 
Csharp :: Difference between IHostingEnvironment and IWebHostEnvironment ? 
Csharp :: c# easy 
Csharp :: system.collections.generic.list 1 system.int32 c# 
Csharp :: C# declare object with values 
Csharp :: cefsharp not passing keydown to form 
Csharp :: telerik mvc grid scroll 
Csharp :: download xml file asp.net web api 
Csharp :: create new directory netrw 
Csharp :: c# wpf datagrid extra column 
Csharp :: .net 6 minimal api authorization net 6 
Csharp :: string to float c# 
Csharp :: set data annotation text in model c# 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =