C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
5
Reply
Differentiate bw the public and private ?
Ahtasham Hassan
10y
700
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
Public can be used everywhere in the application. Private can be access-able only within the scope.
Ayappan Alagesan
8y
0
public can accessible throughout the application private can access only within the class
Manoj Kumar
9y
0
.Net has five access SpecifiersPublic -- Accessible outside the class through object reference.Private -- Accessible inside the class only through member functions.Protected -- Just like private but Accessible in derived classes also through member functions.Internal -- Visible inside the assembly. Accessible through objects.Protected Internal -- Visible inside the assembly through objects and in derived classes outside the assembly through member functions.
Subhashkumar Yadav
9y
0
private is available only in the defined class where as public is available to entire project
Sunil Babu
9y
0
public : The type or member can be accessed by any other code in the same assembly or another assembly that references it.private : The type or member can only be accessed by code in the same class or struct.
Rafnas T P
9y
0
Message