php mcq questions with answers


                                

Which of the following unary operators can be overloaded?

  1. true
  2. false
  3. +
  4. new
  5. is

A.1, 2, 3
B.3, 4, 5
C.3 only
D.5 only
                                

A derived class can stop virtual inheritance by declaring an override as

A.inherits
B.extends
C.inheritable
D.not inheritable
E.sealed
                                

Which of the following keyword is used to change the data and behavior of a base class by replacing a member of a base class with a new derived member?

A.new
B.base
C.overloads
D.override
E.overridable
                                

Which of the following statements is correct?

A.When used as a modifier, the new keyword explicitly hides a member inherited from a base class.
B.Operator overloading works in different ways for structures and classes.
C.It is not necessary that all operator overloads are static methods of the class.
D.The cast operator can be overloaded.
                                

Which of the following keyword is used to overload user-defined types by defining static member functions?

A.op
B.opoverload
C.operator
D.operatoroverload
E.udoperator