أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
Properties store data for an object, and methods are actions an object can be asked to perform
Both are essential part of object oriented programming. When class is created, it must have some attributes, e.g. humans have attributes like their height/weight/skin color etc. Now attributes alone are not sufficient to define a class, the actions or functionality the class performs, also needed to be specified.
Hence with that perspective, attributes are known as Properties and Functionality are known as Methods in C#/vb .net.
Although there are differences between Visual Basic .NET and Visual C# . Net, both are first-class programming languages that are based on the Microsoft .NET Framework, and they are equally powerful. Visual Basic .NET is a true object-oriented programming language that includes new and improved features such as inheritance, polymorphism, interfaces, and overloading. Both Visual Basic .NET and Visual C# .NET use the common language runtime. There are almost no performance issues between Visual Basic .NET and Visual C# .NET. Visual C# .NET may have a few more "power" features such as handling unmanaged code, and Visual Basic .NET may be skewed a little toward ease of use by providing features such as late binding. However, the differences between Visual Basic .NET and Visual C# .NET are very small compared to what they were in earlier versions.
In C# Void keyword is used when method return No value..In VB.Net Sub Keyword is used.
In C# default property can be defined by using Indexers.In VB.Net Default property can be defined by using Default
In C# object must be created using NEW.In VB>Net Object can be created using NEW and CreateObject()
c# uses 'this' keyword where as it is 'me' keyword in vb.net.
c# code to declare a variable ; private int Number;
vb code to declare a variable : private Number as Integer
Method differences :
vb: Private Function DoSomething() as Something()
c# Private DoSomething()
VB usees keyword 'shared' instead of static keyword in c#
C# : Public static DoSomething()
VB : Public Shared DoSomething() as Something()
Textbox1.Text - Text is the property Private Sub SetText() Textbox1.Text = "ZZZ" End Sub SetText() is a method. I think there's a technical difference between methods and procedures, but most people use the terms interchangeably. A function is a method that returns a value, as opposed to just doing something
Only Syntax is different rest it works the same.
There is no difference for properties and methods because both are running on same framework. You can search out for the syntax difference between VB.NET vs C#.NET.
http://www.harding.edu/fmccown/vbnet_csharp_comparison.html
vb.net methods need no curly bracket while c#, curly braces are important for completing a method declaration
Methods are ment to be actions, where as properties ment to be data or fields