Define Class,Module and Access Specifiers .(in detail)
Loading
Define Class,Module and Access Specifiers .(in detail)
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
mallikarjun prasadPosted Jul 13, 2006, 4:54 AM
HI preeti
Class:
A class is a user-defined datatype, which has a state (its representation) and some operations (its behaviour). A class has some internal data and some methods, in the form of Functions and Procedures, and usually describes the generic characteristics and behaviour of a number of similar objects.
A class has following features:
i) Access specifiers
ii) Constructors
iii) Destructors
iv) Data fields
v) Methods (Procedures or Functions)
Methods:
Methods are the functions and procedures that belong to a class. Methods too can have different access levels like data fields. Their visibility depends on the field’s access level. Functions return value whereas procedures don’t have a return value. Methods can be private, public or protected. Each of which are accessible to the outside world as their access rights.
Classes have four levels of access:
1) Private:
Private directive denotes fields and methods of a class that are not accessible outside the unit that declare the class.
2) Public:
Public directive denotes fields and methods that are freely accessible from any other portion of a program as well as in the unit in which they are defined.
3) Protected:
Protected directive is used to indicate methods and fields with limited visibility. Only the current class and its subclasses can access protected elements.
4) Published:
A published field or method is available not only at runtime but at design time too. They have same visibility as that of public members. Infact, every component in Delphi component’s palette has a published interface that is used by some Delphi tools, in particular, the object inspector.