Classes, Objects, and Structures

 Object-Oriented Programming (OOP) is a software development paradigm that suggests developers to split a program in building blocks known as objects. The OOP paradigm allows developers to define the object as data, functions, and its relationship with other objects.
  
  Class  
  The most common definition states that a class is a template for an object.
  Access keywords
   Access keywords define the access to class members from the same class and from other classes. The most common access keywords are:

   Public: Allows access to the class member from any other class. 
   Private: Allows access to the class member only in the same class. 
   Protected: Allows access to the class member only within the same class and from inherited classes. 
   Internal: Allows access to the class member only in the same assembly. 
   Protected internal: Allows access to the class member only within the same class, from inherited classes, and other classes in the same assembly. 
   Static: Indicates that the member can be called without first instantiating the class.

   Object
   Objects are the building blocks of OOP and are commonly defined as variables or data structures that encapsulate behavior and data in a programmed unit. Objects are items that can be individually created, manipulated, and represent real world things in an abstract way. 

   Structures
   Not everything in the real world should be represented as a class. Structures are suitable to represent lightweight objects. Structures can have methods and properties and are useful for defining types that act as user-defined primitives, but contain arbitrary composite fields. 

posted on 2006-03-02 21:50  无心三立  阅读(187)  评论(0编辑  收藏  举报

导航