Thursday, January 23, 2014

different between Vb.net and C#.


Visual Basic is not case sensitive, which means any combinations of upper and lower cases in keywords are acceptable.

However Visual Studio automatically converts all Visual Basic keywords to the default capitalised forms, e.g. "Public", "If".



C# is case sensitive and all C# keywords are in lower cases.

Visual Basic and C# share most keywords, with the difference being the default (Remember Visual Basic is not case sensitive)

Visual Basic keywords are the capitalised versions of the C# keywords, e.g. "Public" vs "public", "If" vs "if".



A few keywords have very different versions in Visual Basic and C#:

Friend vs internal - access modifiers allowing inter-class but not intra-assembly reference

Me vs this - a self-reference to the current object instance

MustInherit vs abstract - prevents a class from being directly instantiated, and forces consumers to create object references to only derived classes

MustOverride vs abstract - for forcing derived classes to override this method

MyBase vs base - for referring to the base class from which the current class is derived

NotInheritable vs sealed - for declaring classes that may not be inherited

NotOverridable vs sealed - for declaring methods that may not be overridden by derived classes

Overridable vs virtual - declares a method as being able to be overridden in derived classes

Shared vs static - for declaring methods that do not require an explicit instance of an object



 

No comments:

Post a Comment