logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Polymorphism See What Others Are Saying!
  • Question
  • Which of the following operators cannot be overloaded?

    1. true
    2. false
    3. new
    4. ~
    5. sizeof


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

  • Correct Answer
  • 3, 5 


  • More questions

    • 1. 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?

    • Options
    • A. Attribute
    • B. Delegate
    • C. Namespace
    • D. Interface
    • E. Encapsulation
    • Discuss
    • 2. When would a structure variable get destroyed?

    • Options
    • A. When no reference refers to it, it will get garbage collected.
    • B. Depends upon whether it is created using new or without using new.
    • C. When it goes out of scope.
    • D. Depends upon the Project Settings made in Visual Studio.NET.
    • E. Depends upon whether we free it's memory using free() or delete().
    • Discuss
    • 3. Which of the following will be the correct output for the C#.NET program given below?

      namespace CuriousTabConsoleApplication
      { 
          struct Sample
          {
              public int i;
          }
          class MyProgram
          { 
              static void Main()
              {
                  Sample x = new Sample(); 
                  x.i = 10; 
                  fun(x); 
                  Console.Write(x.i + " ");
              }
              static void fun(Sample y)
              {
                  y.i = 20; 
                  Console.Write(y.i + " ");
              } 
          } 
      }

    • Options
    • A. 10 20
    • B. 10 10
    • C. 20 10
    • D. 20 20
    • E. None of the above
    • Discuss
    • 4. Which of the following will be the correct output for the C#.NET code snippet given below?

      String s1 = "Five Star";
      String s2 = "FIVE STAR";
      int c;
      c = s1.CompareTo(s2);
      Console.WriteLine(c);

    • Options
    • A. 0
    • B. 1
    • C. 2
    • D. -1
    • E. -2
    • Discuss
    • 5. Which of the following correctly describes the contents of the filename AssemblyInfo.cs?

    • Options
    • A. It contains method-level attributes.
    • B. It contains class-level attributes.
    • C. It contains assembly-level attributes.
    • D. It contains structure-level attributes.
    • E. It contains namespace-level attributes.
    • Discuss
    • 6. Which of the following is the correct implementation of the interface given below?

      interface IMyInterface
      { 
          double MyFun(Single i);
      }

    • Options
    • A.
      class MyClass
      {
          double MyFun(Single i) as IMyInterface.MyFun
          {
              // Some code
          }
      }
    • B.
      class MyClass 
      {
          MyFun (Single i) As Double
          {
              // Some code
          } 
      }
    • C.
      class MyClass: implements IMyInterface
      {
          double fun(Single si) implements IMyInterface.MyFun()
          {
              //Some code
          } 
      }
    • D.
      class MyClass: IMyInterface
      {
          double IMyInterface.MyFun(Single i)
          {
              // Some code
          } 
      }
    • Discuss
    • 7. A function returns a value, whereas a subroutine cannot return a value.

    • Options
    • A. True
    • B. False
    • Discuss
    • 8. Which of the following statements are correct about the C#.NET code snippet given below?

      namespace CuriousTabConsoleApplication
      { 
          class Sample
          { 
              int i, j; 
              public void SetData(int ii, int jj)
              {
                  this.i = ii;
                  this.j = jj 
              } 
          } 
          class MyProgram
          { 
              static void Main(string[ ] args)
              { 
                  Sample s1 = new Sample(); 
                  s1.SetData(10, 2); 
                  Sample s2 = new Sample(); 
                  s2.SetData(5, 10); 
              } 
          } 
      }

    • Options
    • A. The code will not compile since we cannot explicitly use this.
    • B. Using this in this program is necessary to properly set the values in the object.
    • C. The call to SetData() is wrong since we have not explicitly passed the this reference to it.
    • D. The definition of SetData() is wrong since we have not explicitly collected the this reference.
    • E. Contents of this will be different during each call to SetData().
    • Discuss
    • 9. Which of the following are valid .NET CLR JIT performance counters?

      1. Total memory used for JIT compilation
      2. Average memory used for JIT compilation
      3. Number of methods that failed to compile with the standard JIT
      4. Percentage of processor time spent performing JIT compilation
      5. Percentage of memory currently dedicated for JIT compilation

    • Options
    • A. 1, 5
    • B. 3, 4
    • C. 1, 2
    • D. 4, 5
    • Discuss
    • 10. Which of the following statements are correct about a .NET Assembly?

      1. It is the smallest deployable unit.
      2. Each assembly has only one entry point - Main(), WinMain() or DLLMain().
      3. An assembly can be a Shared assembly or a Private assembly.
      4. An assembly can contain only code and data.
      5. An assembly is always in the form of an EXE file.

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


    Comments

    There are no comments.

Enter a new Comment