Sail E0 Webinar
Question
Which of the following are correct ways of creating an array?(i) state[0] = "karnataka;(ii) $state[] = array("karnataka);(iii) $state[0] = "karnataka;(iv) $state = array("karnataka);
Options:
A .  (iii) and (iv)
B .  (ii) and (iii)
C .  Only (i)
D .  (ii), (iii) and (iv)
Answer: Option A


A variable name should start with $ symbol which is not present in i) and you need not put the square brackets when you use the array() constructor.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :


Latest Videos

Latest Test Papers