Linked Questions

7 votes
2 answers
29k views

Possible Duplicate: Difference between Property and Field in C# I thought that basic properties ({ get; set; }) where the same as public fields, with only the advantage of being able to change ...
Baruch's user avatar
  • 22k
6 votes
5 answers
2k views

is there any effective difference between Foo.Something and Bar.Something in this example? class Foo { public string Something; } class Bar { public string Something{get; set;} } class ...
adekcz's user avatar
  • 410
3 votes
4 answers
5k views

Possible Duplicate: Difference between Property and Field in C# .NET 3.5+ What's the difference between using public string Username { get; set; } and using public string Username; I have ...
Yasser Shaikh's user avatar
1 vote
5 answers
8k views

I do not understand the difference between static properties: public static int intId; and get;set; properties: public int intId { get { return intId; } set { intId = value; } } ...
Anjali's user avatar
  • 1,738
0 votes
5 answers
198 views

Possible Duplicate: Difference between Property and Field in C# public class Test { public bool testData1; public string testData2; } or public class Test { public bool TestData1 { ...
haxxoromer's user avatar
2 votes
1 answer
7k views

Possible Duplicate: What is the difference between a field and a property in C#? Difference between Property and Field in C# .NET 3.5+ Some time ago I inherited a C# web app wherein most class ...
svidgen's user avatar
  • 14.4k
2 votes
3 answers
3k views

Possible Duplicate: What is the difference between a field and a property in C#? Difference between Property and Field in C# .NET 3.5+ I have seen that in c# the following pattern is common: ...
mmilan's user avatar
  • 1,776
3 votes
3 answers
571 views

What makes properties and Fields different when we are passing Fields as an out/ref parameter . Does the difference between the two is memory allocation?
Dhiren's user avatar
  • 448
0 votes
2 answers
2k views

I've learned about the getter and setter topic and i couldn't understand the new type of this topic : Let's say someone is declaring a new get&set method : public int Id { get; set; }; What i ...
user3385390's user avatar
1 vote
2 answers
151 views

Need to understand the benefit of using automatic properties apart from less line of codes? Intially we used as below : private int sample; public int Sample { get {return sample}; set {this....
Meg's user avatar
  • 13
1 vote
4 answers
120 views

Should I prefer getting variable from other class directly(int number = something.number;) or should I use a function for getting that number(like in example below)? What is the difference? class ...
Gintas_'s user avatar
  • 5,050
0 votes
3 answers
164 views

Possible Duplicate: Difference between Property and Field in C# .NET 3.5+ Sample code: public struct State { private readonly byte state; private State (byte pState) { state =...
apocalypse's user avatar
  • 5,914
1 vote
3 answers
282 views

Possible Duplicate: Difference between Property and Field in C# .NET 3.5+ Why should I use an automatically implemented property instead of a field? Both Examples below do exactly the same, have ...
Robula's user avatar
  • 716
-3 votes
1 answer
80 views

I see that i can declare public properties in two ways. Both of them have get / set accessors, but what is the difference between them? class Job { public int Interval { get; set; } public ...
Catalin's user avatar
  • 11.8k
2 votes
1 answer
194 views

Possible Duplicate: Difference between Property and Field in C# I started a new job a couple of weeks ago using C# (something I've basically started learning -since- being there) and I've seen a ...
user1217210's user avatar

15 30 50 per page
1
2 3 4 5