Define Class,Module and Access Specifiers .(in detail)
Define Class,Module and Access Specifiers (its urgent).
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Define Class,Module and Access Specifiers .(in detail)
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
mallikarjun prasad17 reputationPosted Jul 13, 2006, 12:54 AM EDT
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.