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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me what are the __construct() and __destruct() methods in a php class?

498


Do you know what is the function func_num_args() used for?

554


What is the use of final class in php?

504


How many escape sequences are recognized in double-quoted strings?

533


Why use php artisan serve?

495






What is a path Traversal?

551


What are the different tables(engine) present in mysql, which one is default?

504


What are the difference between array_keys() and array_key_exists() in php?

531


Tell me how to set a page as a home page in a php based site?

498


How to run a php script?

564


What is the function to count elements in an array in PHP?

618


How many data types are there in php?

582


How to process the uploaded files?

578


Tell me how to create a text file in php?

542


What is mysqli_fetch_array?

513