logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Polymorphism See What Others Are Saying!
  • Question
  • A derived class can stop virtual inheritance by declaring an override as


  • Options
  • A. inherits
  • B. extends
  • C. inheritable
  • D. not inheritable
  • E. sealed

  • Correct Answer
  • sealed 


  • More questions

    • 1. 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
    • 2. Which of the following CANNOT belong to a C#.NET Namespace?

    • Options
    • A. class
    • B. struct
    • C. enum
    • D. Data
    • E. interface
    • Discuss
    • 3. 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
    • 4. 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
    • Discuss
    • 5. Which of the following statements are correct about an interface in C#.NET?

      1. A class can implement multiple interfaces.
      2. Structures cannot inherit a class but can implement an interface.
      3. In C#.NET, : is used to signify that a class member implements a specific interface.
      4. An interface can implement multiple classes.
      5. The static attribute can be used with a method that implements an interface declaration.

    • Options
    • A. 1, 2, 3
    • B. 2, 4
    • C. 3, 5
    • D. None of the above.
    • Discuss
    • 6. Which of the following should be used to implement a 'Like a' or a 'Kind of' relationship between two entities?

    • Options
    • A. Polymorphism
    • B. Containership
    • C. Templates
    • D. Encapsulation
    • E. Inheritance
    • Discuss
    • 7. Which of the following is NOT an Exception?

    • Options
    • A. StackOverflow
    • B. Division By Zero
    • C. Insufficient Memory
    • D. Incorrect Arithmetic Expression
    • E. Arithmetic overflow or underflow
    • Discuss
    • 8. Which of the following can implement an interface?

      1. Data
      2. Class
      3. Enum
      4. Structure
      5. Namespace

    • Options
    • A. 1, 3
    • B. 2, 4
    • C. 3, 5
    • D. 4 only
    • Discuss
    • 9. It is compulsory for all classes whose objects can be thrown with throw statement to be derived from System.Exception class.

    • Options
    • A. True
    • B. False
    • Discuss
    • 10. What will be the output of the C#.NET code snippet given below?

      namespace CuriousTabConsoleApplication
      { 
          class SampleProgram
          { 
              static void Main(string[] args)
              { 
                  int[]arr = newint[]{ 1, 2, 3, 4, 5 }; 
                  fun(ref arr);
              }
              static void fun(ref int[] a)
              { 
                  for (int i = 0; i < a.Length; i++)
                  { 
                      a[i] = a[i] * 5; 
                      Console.Write(a[ i ] + " "); 
                  } 
              } 
          } 
      }

    • Options
    • A. 1 2 3 4 5
    • B. 6 7 8 9 10
    • C. 5 10 15 20 25
    • D. 5 25 125 625 3125
    • E. 6 12 18 24 30
    • Discuss


    Comments

    There are no comments.

Enter a new Comment