Click here to Skip to main content
14,237,525 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am reviewing some basic concept in C#.
A.
public FileStream Stream { get; private set; }

B.
public FileStream Stream { get; set; }

What is the difference between A and B?
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Very simple answer.

A says that Stream property is not accessible to set value publicly(means outside of the class it is not allowed to set value to this property), it is accessible to get the value outside of the class.

while

B says that you can get and set the value to the property outside of the class also.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100