The LBTT Spot
"Lifeline is focused on developing and marketing systems designed to assist in the early detection of breast and ovarian cancer."
C# Reference - C# Access Modifiers - private
View C# Source Code
Article Categories:
.Net Framework
.Net Framework 1.1
ADO.NET
ASP.NET
Assemblies
Asynchronous Methods
C#
Collections
Configuration
Delegates
Events
Pocket PC
Regular Expressions
Smart Devices
SQL Server
Visual C#
Visual Studio .NET
Visual Studio .NET 2003
Windows Forms
XML
C# .Net Fun Menu
View Current Page's ASP.NET Source Code
C# Reference
C# Study Flash Cards
Valuable Links
Contact Us
Site Map
Mike's Portfolio
C# Reference Search:
Full Text Search:
Articles by Author:
Mike G.
Code Examples (zipped):
MTGUpTime.zip
ThreadLockingE...
ThreadingExamp...
RemotingExampl...
ErrorProviderE...
DelegateExampl...
CustomArrayLis...
AsynchronousEx...
C# Reference
C# Access Modifiers
private
C# Access Modifiers: [private] Reference from Microsoft
®
Class members defined as
private
can only be accessed by the class in which they are defined.
public class MyClass { private String strMyString = "test..."; public MyClass() { // we can access strMyString from this class: String strTest = strMyString; } } public class MyClass2 { public MyClass2() { // we cannot access a class' private members at all: MyClass mc = new MyClass(); String strTest = mc.strMyString; // oops... will cause an error! } }