php mcq questions with answers


                                

Which of the following statements is incorrect about a delegate?

A.A single delegate can invoke more than one method.
B.Delegates can be shared.
C.Delegate is a value type.
D.Delegates are type-safe wrappers for function pointers.
E.The signature of a delegate must match the signature of the method that is to be called using it.
                                

Suppose a Generic class called SortObjects is to be made capable of sorting objects of any type (Integer, Single, Byte etc.). Which of the following programming constructs should be used to implement the comparision function?

A.Namespace
B.Interface
C.Encapsulation
D.Delegate
E.Attribute
                                

With which of the following can the ref keyword be used?

  1. Static data
  2. Instance data
  3. Static function/subroutine
  4. Instance function/subroutine

A.1, 2
B.3, 4
C.1, 3
D.2, 4
E.All of the above
                                

The [Serializable()] attribute gets inspected at

A.Compile-time
B.Run-time
C.Design-time
D.Linking-time
E.None of the above
                                

Which of the following are correct ways to pass a parameter to an attribute?

  1. By value
  2. By reference
  3. By address
  4. By position
  5. By name

A.1, 2
B.1, 2, 3
C.4, 5
D.All of the above