user87393
user87393

Reputation: 155

How can I tell if something is a property or a method?

I am new to programming. Using C# & ASP.Net, how would I differentiate between a property & a method? How can I tell if something is a property or a method?

Upvotes: 0

Views: 335

Answers (3)

Jason Williams
Jason Williams

Reputation: 57902

Another approach (i.e. not using intellisense) is to call the method/property and compile your code. If you've used the wrong syntax the compiler will let you know.

Upvotes: 0

Philip Fourie
Philip Fourie

Reputation: 116867

Method calls have to be called with parenthesis, where not with Properties

Upvotes: 1

Mehrdad Afshari
Mehrdad Afshari

Reputation: 422026

Visual Studio displays different icons in the IntelliSense list. It's mentioned in the documentation too:

Visual Studio IntelliSense list http://img1.myimg.de/intellisense88c76.png

You don't use parenthesis to access properties but you always do when you're calling methods.

Upvotes: 3

Related Questions