To create an object for a class we need to use the keyword "new"
Example
$phpqna = new Phpinterview();
Now the instance is created and assigned to the variable $phpqna
Also we can create any number of instances to a single class
Example
$phpqna1 = new Phpinterview();
$phpqna2 = new Phpinterview();
No comments:
Post a Comment