To create an object from a class named Cart that requires two arguments, you code a. new Cart($arg1, $arg2) b. Cart_constructor($arg1, $arg2) c. new Cart(arg1, arg2) d. Cart_constructor(arg1, arg2)

Respuesta :

Answer:

Option a is the correct answer for the above question.

Explanation:

  • The above question has the option in which two option holds a syntax which is used to declare a variable in PHP language. So the answer is on behalf of the PHP language.
  • When a user wants to create an object of any class with the two-parameter in PHP language, then he can do it by the help of "class_name object_name= new class_name($argument1,$argument2)".
  • The option 'a' follows the above syntax to create an object of Cart class. Hence it is a correct option while the other is not because:
  1. Option b states a syntax in which the new keyword is not defined which is used to create a new object.
  2. Option c states that option in which '
    ACCESS MORE
    EDU ACCESS
    Universidad de Mexico
is not defined to declare a variable.
  • Option d states that option in which '
    ACCESS MORE
    EDU ACCESS
    Universidad de Mexico
  • is not defined to declare a variable.

    ACCESS MORE
    EDU ACCESS
    Universidad de Mexico