logo

CuriousTab

CuriousTab

Discussion


Home C# Programming .NET Framework See What Others Are Saying!
  • Question
  • Which of the following are NOT true about .NET Framework?

    1. It provides a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely.
    2. It provides a code-execution environment that minimizes software deployment and versioning conflicts.
    3. It provides a code-execution environment that promotes safe execution of code, including code created by an unknown or semi-trusted third party.
    4. It provides different programming models for Windows-based applications and Web-based applications.
    5. It provides an event driven programming model for building Windows Device Drivers.


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

  • Correct Answer
  • 4, 5 


  • More questions

    • 1. What will be the output of the C#.NET code snippet given below?

      int val;
      for (val = -5; val <= 5; val++)
      {
          switch (val)
          {
              case 0:
                  Console.Write ("India"); 
                  break;
          }
          
          if (val > 0)
              Console.Write ("B"); 
          else if (val < 0)
              Console.Write ("X");
      }

    • Options
    • A. XXXXXIndia
    • B. IndiaBBBBB
    • C. XXXXXIndiaBBBBB
    • D. BBBBBIndiaXXXXX
    • E. Zero
    • Discuss
    • 2. Which of the following forms of applying an attribute is correct?

    • Options
    • A.
      < Serializable() > class sample
      { /* ... */ }
    • B.
      (Serializable()) class sample
      { /* ... */ }
    • C.
      [ Serializable() ] class sample
      { /* ... */ }
    • D.
      Serializablef) class sample
      { /* ... */ }
    • E. None of the above
    • Discuss
    • 3. Which of the following statements are correct about the exception reported below?
      Unhandled Exception: System.lndexOutOfRangeException: Index was outside the bounds of the array: at CuriousTabConsoleApplication.MyProgram.SetVal(Int32 index, Int32 val) in D:\Sample\CuriousTabConsoleApplication\MyProgram.cs:line 26 at CuriousTabConsoleApplication.MyProgram.Main(String[] args) in D:\Sample\CuriousTabConsoleApplication\MyProgram.cs:line 20

      1. The CLR failed to handle the exception.
      2. The class MyProgram belongs to the namespace MyProgram.
      3. The function SetVal() was called from Main() in line number 20.
      4. The exception occurred in line number 26 in the function SetVal()
      5. The runtime exception occurred in the project CuriousTabConsoleApplication.

    • Options
    • A. 1 only
    • B. 1 and 2 only
    • C. 3, 4 and 5 only
    • D. All of the above
    • E. None of the above
    • Discuss
    • 4. Which of the following is the correct way to call the function MyFun() of the Sample class given below?

      class Sample
      {
          public int MyFun(int i)
          {
              Console.WriteLine("Welcome to CuriousTab.com !" );
              return 0;
          }
      }

    • Options
    • A.
      delegate void del(int i);
      Sample s = new Sample();
      deld = new del(ref s.MyFun);
      d(10);
    • B.
      delegate int del(int i);
      Sample s = new Sample(.);
      del = new delegate(ref MyFun);
      del(10);
    • C.
      Sample s = new Sample();
      delegate void del = new delegate(ref MyFun);
      del(10);
    • D.
      delegate int del(int i);
      del d;
      Sample s = new Sample();
      d = new del(ref s.MyFun);
      d(10);
    • Discuss
    • 5. Which of the following statements is correct about the C#.NET code snippet given below?

      interface IPerson
      { 
          String FirstName
          { 
              get; 
              set;
          }
          String LastName
          {
              get; 
              set;
          }
          void Print(); 
          void Stock(); 
          int Fun(); 
      }

    • Options
    • A. Properties cannot be declared inside an interface.
    • B. This is a perfectly workable interface.
    • C. The properties in the interface must have a body.
    • D. Subroutine in the interface must have a body.
    • E. Functions cannot be declared inside an interface.
    • Discuss
    • 6. Which of the following statements is correct about an interface used in C#.NET?

    • Options
    • A. If a class implements an interface partially, then it should be an abstract class.
    • B. A class cannot implement an interface partially.
    • C. An interface can contain static methods.
    • D. An interface can contain static data.
    • E. Multiple interface inheritance is not allowed.
    • Discuss
    • 7. 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.

    • Options
    • A. 1 and 2 only
    • B. 1, 2 and 3 only
    • C. 2, 4 and 5 only
    • D. 4 and 5 only
    • E. All of the above
    • Discuss
    • 8. If a Student class has an indexed property which is used to store or retrieve values to/from an array of 5 integers, then which of the following are the correct ways to use this indexed property?

      1. Student[3] = 34;
      2. Student s = new Student(); 
        s[3] = 34;
      3. Student s = new Student(); 
        Console.WriteLine(s[3]);
      4. Console.WriteLine(Student[3]);
      5. Student.this s = new Student.this(); 
        s[3] = 34;

    • Options
    • A. 1, 2
    • B. 2, 3
    • C. 3, 4
    • D. 3, 5
    • Discuss
    • 9. Which of the following CANNOT belong to a C#.NET Namespace?

    • Options
    • A. class
    • B. struct
    • C. enum
    • D. Data
    • E. interface
    • Discuss
    • 10. A class implements two interfaces each containing three methods. The class contains no instance data. Which of the following correctly indicate the size of the object created from this class?

    • Options
    • A. 12 bytes
    • B. 24 bytes
    • C. 0 byte
    • D. 8 bytes
    • E. 16 bytes
    • Discuss


    Comments

    There are no comments.

Enter a new Comment