C Sample Test,Sample questions

Question:
 
Which of the following statements are correct about the delegate declaration given below?

    delegate void del(int i);
1. On declaring the delegate a class called del will get created.
2. The signature of del need not be same as the signature of the method that we intend to call using it.
3. The del class will be derived from the MulticastDelegate class.
4. The method that can be called using del should not be a static method.
5. The del class will contain a one-argument constructor and an lnvoke() method.

1.1, 2 and 3 only

2.1, 3 and 5 only

3.2 and 4 only

4.4 only


Question:
  
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?

1.Namespace

2.Interface

3.Encapsulation

4.Delegate


Question:
  
Which of the following statements is incorrect about a delegate?

1.A single delegate can invoke more than one method.

2.Delegates can be shared.

3.Delegate is a value type.

4.Delegates are type-safe wrappers for function pointers.


Question:
In which of the following areas are delegates commonly used?

1. Remoting
2. Serialization
3. File Input/Output
4. Multithreading
5. Event handling

1. 1 and 2 only

2.4 and 5 only

3. 1,2 and 3 only

4.4 and 5 only


Question:
Which of the following statements is incorrect about delegate?

1.Delegates are reference types.

2. Delegates are object oriented.

3. Delegates are type-safe.

4.Only one method can be called using a delegate.


Question:
Suppose on pushing a button an object is to be notified, but it is not known until runtime which object should be notified. Which of the following programming constructs should be used to implement this idea?

1.Attribute

2.Delegate

3.Namespace

4.Interface


Question:
Which of the following is the necessary condition for implementing delegates?

1.Class declaration

2.Inheritance

3.Run-time Polymorphism

4.Exceptions


Question:
Which of the following statements are correct about a delegate?

1. Inheritance is a prerequisite for using delegates.
2. Delegates are type-safe.
3. Delegates provide wrappers for function pointers.
4. The declaration of a delegate must match the signature of the method that we intend to call using it.
5. Functions called using delegates are always late-bound.

1.1 and 2 only

2.1, 2 and 3 only

3.2, 3 and 4 only

4. All of the above


Question:
Which of the following statements are correct about delegates?

1. Delegates are not type-safe.
2. Delegate is a user-defined type.
3. Only one method can be bound with one delegate object.
4. Delegates can be used to implement callback notification.
5. Delegates permit execution of a method on a secondary thread in an asynchronous manner.

1.1 and 2 only

2.1, 2 and 3 only

3.2, 4 and 5 only

4.4 and 5 only


Question:
Which of the following statements are correct about delegates?

1.Delegates cannot be used to call a static method of a class.

2.Delegates cannot be used to call procedures that receive variable number of arguments.

3.If signatures of two methods are same they can be called through the same delegate object.

4. Delegates cannot be used to call an instance function. Delegates cannot be used to call an instance subroutine.


Question:
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

1.1,2

2.3,4

3.1,3

4.2,4


More MCQS

  1. C# MCQS -Programming (.NET Framework)
  2. C# MCQS -Programming(Control Instructions)
  3. C# MCQS - Functions and Subroutines(.NET Framework)
  4. C# Programming-Constructors
  5. C# Programming- Arrays
  6. C# Programming -Structures
  7. C# Programming-Properties
  8. C# Programming -Exception Handling
  9. C# Programming -Interfaces
  10. C# Programming -Delegates
  11. C# Programming -Generics
  12. C# Programming - Datatypes
  13. C# Programming- Operators
  14. C# Programming -Classes and Objects
  15. NET Programming mcqs
  16. Computer Science Engineering (CSE) .NET Programming
  17. C# Programming Mcq Set 1
  18. C# Programming Mcq Set 2
  19. C#.NET Programming Mcq
Learn ,Learn C Objetive choice questions and answers,C Multiple choice questions and answers,C objective, C questions , C answers,C MCQs questions and answer
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!