C# MCQ With Questions and Answer

                                
What XML component does the following XPath query try to match? //foo[bar/@id=5]
A.bar element with an id attribute whose value is equal to 5
B.foo element containing a child node bar tag
C.id attribute whose value is equal to 5
D.foo element with a child note bar whose id attribute is equal to 5
E.all of the foo elements that have a child node bar, whose id attribute is equal to 5
                                
What is the output of the following script? <?php class a { public $val; } function renderVal (a $a) { if ($a) { echo $a->val; } } renderVal (null); ?>
A.A syntax error in the function declaration line
B.An error, because null is not an instance of 'a'
C.Nothing, because a null value is being passed to renderVal()
D.NULL
                                
Transactions can be used to: (Choose 2)
A.Recover from errors in case of a power outage or a failure in the SQL connection
B.Ensure that the data is properly formatted
C.Ensure that either all statements are performed properly, or that none of them are.
D.Recover from user errors
                                
Type hinting in PHP allows the identification of the following variable types: (Choose 2)
A.String
B.Integer
C.Array
D.Any class or interface type