Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am reviewing some basic concept in C#.
A.
C#
public FileStream Stream { get; private set; }

B.
C#
public FileStream Stream { get; set; }

What is the difference between A and B?
Posted

1 solution

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900