@page { margin: 2cm }
th p { margin-bottom: 0cm; direction: ltr; color: #000000; orphans: 2; widows: 2 }
th p.western { font-family: “Liberation Serif”, “Times New Roman”, serif; font-size: 12pt; so-language: en-IN }
th p.cjk { font-family: “Noto Sans CJK SC”; font-size: 12pt; so-language: zh-CN }
th p.ctl { font-family: “Lohit Devanagari”; font-size: 12pt; so-language: hi-IN }
td p { margin-bottom: 0cm; direction: ltr; color: #000000; orphans: 2; widows: 2 }
td p.western { font-family: “Liberation Serif”, “Times New Roman”, serif; font-size: 12pt; so-language: en-IN }
td p.cjk { font-family: “Noto Sans CJK SC”; font-size: 12pt; so-language: zh-CN }
td p.ctl { font-family: “Lohit Devanagari”; font-size: 12pt; so-language: hi-IN }
h2 { direction: ltr; color: #000000; orphans: 2; widows: 2 }
h2.western { font-family: “Liberation Serif”, “Times New Roman”, serif; so-language: en-IN }
h2.cjk { font-family: “Noto Sans CJK SC”; so-language: zh-CN }
h2.ctl { font-family: “Lohit Devanagari”; so-language: hi-IN }
p { margin-bottom: 0.25cm; direction: ltr; color: #000000; line-height: 115%; orphans: 2; widows: 2 }
p.western { font-family: “Liberation Serif”, “Times New Roman”, serif; font-size: 12pt; so-language: en-IN }
p.cjk { font-family: “Noto Sans CJK SC”; font-size: 12pt; so-language: zh-CN }
p.ctl { font-family: “Lohit Devanagari”; font-size: 12pt; so-language: hi-IN }
code.cjk { font-family: “Courier New”, monospace }
a:link { so-language: zxx }
-
public
: When we define class members as public, then they are accessible from anywhere, even from outside of the class scope. -
private
: When we define class members as private, they can only be accessed from within the class itself. -
protected
: This is same as private, with one exception, the class members defined as protected can still be accessed from its subclass(We will learn about subclasses when we will learn about Inheritance). -
abstract
: This keyword is only used for PHP classes and its member functions. -
final
: The class methods defined as final, can not be changed or overriden by any subclass.
When to use Which Access Modifier: We cannot use all the available access modifers with class, its varibales and methods. In the table below, we have specified which access specifier is applied to what:
Access Modifer |
classes |
functions |
variables |
---|---|---|---|
public |
Not Applicable |
Applicable |
Applicable |
private |
Not Applicable |
Applicable |
Applicable |
protected |
Not Applicable |
Applicable |
Applicable |
abstract |
Applicable |
Applicable |
Not Applicable |
final |
Applicable |
Applicable |
Not Applicable |
Leave a comment