www.pickatutorial.com Computer Tutorials
Top eBooks: C/C++ | C# | Android | Mathematics | Database | Cloud | Graphics | Networking | Oracle | Hardware | AI
Top Tutorials: C/C++ | C#.NET | PHP MySQL | Java | Java Script | jQuery | HTML | xHTML | HTML5 | VB Script| CSS
Lessons C# Objects and Classes 2 Bookmark and Share
Tutorial Home
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Lesson 14
Lesson 15
Lesson 16
Lesson 17
Lesson 18
Lesson 19
Lesson 20
Lesson 21
Lesson 22
Lesson 23
In this lesson we will continue our discussion on C# Obects and Classes. In this lesson we will discuss access modifiers related to classes and object in C#.

In C#, we have the following modifiers available:
  • public: same as C++
  • internal: internal is accessible only to types within the same assembly which is similar to package in Java.
  • protected: same as C++
  • internal protected: protected within the same assembly
  • private: same as C++
  • new: The 'new' keyword can be used for 'nested' classes. A nested class is one that is defined in the body of another class; it is in most ways identical to a class defined in the normal way, but its access level cannot be more liberal than that of the class in which it is defined. Classes are usually specified independently of each other. But it is possible for one class to be specified within another's specification. In this case, the later class is termed as a nested class. A nested class should be declared using the 'new' keyword just in case it has the same name as (and thus overrides) an inherited type.
  • abstract: A class declared as 'abstract' cannot itself be instanced - it is designed only to be a base class for inheritance.
  • sealed: A class declared as 'sealed' cannot be inherited from. It may be noted that structs can also not be inherited from.

Next >>> Lesson No. 16: C# Methods

Home - Advertise - Contact - Disclaimer - About Us
© Since 2006 pickatutorial.com -- All Rights Reserved.