What are the differences between public, private, protected,
static, transient, final and volatile?

Answers were Sorted based on User's Feedback



What are the differences between public, private, protected, static, transient, final and volatile?..

Answer / nikunj

Public : access anyware in script
Protected: access only same class and access inherited class
Private: access only in same class
Final: restrict overriding with child class

Is This Answer Correct ?    59 Yes 3 No

What are the differences between public, private, protected, static, transient, final and volatile?..

Answer / naresh

in object by default all variables are presistent. so some
time we want to avoid that variables means we use transient
for that variable.

Is This Answer Correct ?    5 Yes 8 No

What are the differences between public, private, protected, static, transient, final and volatile?..

Answer / bharanikumar

can u plz give me more informa for protected

Is This Answer Correct ?    2 Yes 11 No

Post New Answer

More PHP Interview Questions

Is laravel an oop?

0 Answers  


How to access standard error stream in PHP?

0 Answers  


what is variable scope, which variables are accessible from where and what are "undefined variable" errors?

0 Answers  


What are the different filter functions used to filter a variable?

0 Answers  


How does session work in php?

0 Answers  






What is the default session time in php?

0 Answers  


What is the method to execute a php script from the command line?

0 Answers  


Explain how is it possible to set an infinite execution time for php script?

0 Answers  


What are getters and setters and why are they important?

0 Answers  


Is php pass by reference or value?

0 Answers  


Dear Sir, i am a frasher and now i got a job offer from AentteQ Software Technologies for PHP developer.. so i am in confusion that is PHP correct for my carrer or i shud choose other then php for my carrer...plz suggest me

4 Answers   NIIT,


Write a hello world program using variable?

0 Answers  


Categories