logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Polymorphism See What Others Are Saying!
  • Question
  • Which of the following keyword is used to change the data and behavior of a base class by replacing a member of a base class with a new derived member?


  • Options
  • A. new
  • B. base
  • C. overloads
  • D. override
  • E. overridable

  • Correct Answer
  • new 


  • More questions

    • 1. Which of the following will be the correct output for the C#.NET program given below?

      namespace CuriousTabConsoleApplication
      { 
          class Sample
          { 
              int i; 
              Single j; 
              public void SetData(int i, Single j)
              { 
                  this.i = i; 
                  this.j = j;
              }
              public void Display()
              { 
                  Console.WriteLine(i + " " + j);
              } 
          } 
          class MyProgram
          { 
              static void Main(string[ ] args)
              {
                  Sample s1 = new Sample(); 
                  s1.SetData(36, 5.4f); 
                  s1.Display(); 
              } 
          } 
      }

    • Options
    • A. 0 0.0
    • B. 36 5.4
    • C. 36 5.400000
    • D. 36 5
    • E. None of the above
    • Discuss
    • 2. Which of the following is absolutely neccessary to use a class Point present in namespace Graph stored in library?

    • Options
    • A. Use fully qualified name of the Point class.
    • B. Use using statement before using the Point class.
    • C. Add Reference of the library before using the Point class.
    • D. Use using statement before using the Point class.
    • E. Copy the library into the current project directory before using the Point class.
    • Discuss
    • 3. Which of the following statements are correct about subroutines used in C#.NET?

      1. If we do not return a value from a subroutine then a value -1 gets returned.
      2. Subroutine definitions cannot be nested.
      3. Subroutine can be called recursively.
      4. To return the control from middle of a subroutine exit subroutine should be used.
      5. Subroutine calls can be nested.

    • Options
    • A. 1, 2, 3
    • B. 2, 3, 5
    • C. 3, 5
    • D. 3, 4
    • E. None of these
    • Discuss
    • 4. How many enumerators will exist if four threads are simultaneously working on an ArrayList object?

    • Options
    • A. 1
    • B. 3
    • C. 2
    • D. 4
    • E. Depends upon the Project Setting made in Visual Studio.NET.
    • Discuss
    • 5. 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
    • 6. 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
    • 7. 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
    • 8. 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
    • 9. 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
    • 10. 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


    Comments

    There are no comments.

Enter a new Comment