logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Polymorphism See What Others Are Saying!
  • Question
  • Which of the following statements are correct?

    1. All operators in C#.NET can be overloaded.
    2. We can use the new modifier to modify a nested type if the nested type is hiding another type.
    3. In case of operator overloading all parameters must be of the different type than the class or struct that declares the operator.
    4. Method overloading is used to create several methods with the same name that performs similar tasks on similar data types.
    5. Operator overloading permits the use of symbols to represent computations for a type.


  • Options
  • A. 1, 3
  • B. 2, 4
  • C. 2, 5
  • D. 3, 4

  • Correct Answer
  • 2, 5 


  • More questions

    • 1. The space required for structure variables is allocated on stack.

    • Options
    • A. True
    • B. False
    • Discuss
    • 2. Is it possible to invoke Garbage Collector explicitly?

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 3. It possible to create a custom attribute that can be applied only to specific programming element(s) like ____ .

    • Options
    • A. Classes
    • B. Methods
    • C. Classes and Methods
    • D. Classes, Methods and Member-Variables
    • Discuss
    • 4. C#.NET structures are always value types.

    • Options
    • A. True
    • B. False
    • Discuss
    • 5. What does the following C#.NET code snippet will print?

      int i = 0, j = 0; 
      
      label:
          i++;
          j+=i;
      if (i < 10)
      {
          Console.Write(i +" ");
          goto label; 
      }

    • Options
    • A. Prints 1 to 9
    • B. Prints 0 to 8
    • C. Prints 2 to 8
    • D. Prints 2 to 9
    • E. Compile error at label:.
    • Discuss
    • 6. The [Serializable()] attribute gets inspected at

    • Options
    • A. Compile-time
    • B. Run-time
    • C. Design-time
    • D. Linking-time
    • E. None of the above
    • Discuss
    • 7. Code that targets the Common Language Runtime is known as

    • Options
    • A. Unmanaged
    • B. Distributed
    • C. Legacy
    • D. Managed Code
    • E. Native Code
    • Discuss
    • 8. Which of the following are the correct ways to declare a delegate for calling the function func() defined in the sample class given below?

      class Sample
      {
          public int func(int i, Single j)
          {
              /* Add code here. */
          }
      }

    • Options
    • A. delegate d(int i, Single j);
    • B. delegate void d(int, Single);
    • C. delegate int d(int i, Single j);
    • D. delegate void (int i, Single j);
    • E. delegate int sample.func(int i, Single j);
    • Discuss
    • 9. Which of the following statements is correct about properties used in C#.NET?

    • Options
    • A. Every property must have a set accessor and a get accessor.
    • B. Properties cannot be overloaded.
    • C. Properties of a class are actually methods that work like data members.
    • D. A property has to be either read only or a write only.
    • Discuss
    • 10. Which of the following assemblies can be stored in Global Assembly Cache?

    • Options
    • A. Private Assemblies
    • B. Friend Assemblies
    • C. Shared Assemblies
    • D. Public Assemblies
    • E. Protected Assemblies
    • Discuss


    Comments

    There are no comments.

Enter a new Comment