faqts : Computers : Programming : Languages : Delphi

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 13 people (62%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

Delphi:Class:Access:Modifier:Which access modifiers in Delphi?[private/protected/public/published]

Dec 12th, 2003 15:20
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 25 September 2003 - 04:48 pm ------------------

Delphi:Class:Access:Modifier:Which access modifiers in Delphi?
[private/protected/public/published]

1. Class Access Levels

 1. Classes can have four levels of access:

    1. Private
        Available only to this class, and or classes in the same UNIT
        file (e.g. all classes in your unit1.pas file

    2. Protected
        Available to derived classes (so the descendants of that class,
        or thus classes that are inherited from that class)
        and or other classes in the same UNIT file (e.g. all
        classes in your unit1.pas file)

    3. Public
        Available to everybody.

    4. Published
        Especially used when creating components.

        Any components declared in the published section will appear in
        the Object Inspector at design time.

        So you will be able to see (=read) or write that properties in
        the Delphi ObjectInspector.

---

[book: source: - Teach Yourself Borland Delphi 4 in 21 Days - Kent 
Reisdorph - SAMS - ISBN 0672312867 - 
http://www.amazon.com/exec/obidos/tg/detail/-
/0672312867/qid=1064501349/sr=1-1/ref=sr_1_1/103-6292513-4946208?
v=glance&s=books#product-details]

---
---

Internet: see also:

---

Delphi: Class: Friend: Can someone tell me what friend class is in 
Object Pascal?
http://www.faqts.com/knowledge_base/view.phtml/aid/16168/fid/175

---

C#: Class: Access: Modifier: Which access modifiers in C#? [internal / 
private / protected / public]
http://www.faqts.com/knowledge_base/view.phtml/aid/24765/fid/791

---

C++: Class: Access: Modifier: Which access modifiers in C++? [friend / 
private / protected / public]
http://www.faqts.com/knowledge_base/view.phtml/aid/24762/fid/163

---

Java: Class: Access: Modifier: Which access modifiers in Java? [none / 
private / protected / public]
http://www.faqts.com/knowledge_base/view.phtml/aid/24759/fid/165

---

Visual Basic: Class: Access: Modifier: Which access modifiers in 
Visual Basic.NET? [private/public]
http://www.faqts.com/knowledge_base/view.phtml/aid/27365/fid/1610

----------------------------------------------------------------------