C# Interfaces, Inheritance & Polymorphism Mcqs

Our collections of Multiple choice questions and answers focuses on study of Interfaces, Inheritance & Polymorphism. These questions are chosen from a collection of most authoritative and best reference books on C# Interfaces,Inheritance & Polymorphism. Our aim is to prepare an individual for competitive exams like NTS, GAT, ECAT, University and College entrance exams and various Interfaces,Inheritance & Polymorphism comprehensively.

  1. Home
  2. »
  3. Languages
  4. »
  5. Programming Languages Mcqs
  6. »
  7. C# Programming Mcqs
  8. »
  9. Interfaces,Inheritance & Polymorphism Mcqs
  10. »
  11. Page 13

181.
Choose the wrong statement from the given set of statements?

All operators in C#.NET cannot be overloaded

We can use the new modifier to modify a nested type if the nested type is hiding another type

Operator overloading permits the use of symbols to represent computations for a type

In case of operator overloading all parameters must be of different type than the class or struct that declares the operators

182.
What is Recursion in CSharp defined as?

Recursion is another form of class

Recursion is another process of defining a method that calls other methods repeatedly

Recursion is a process of defining a method that calls itself repeatedly

Recursion is a process of defining a method that calls other methods which in turn calls this method

183.
Which of these will happen if recursive method does not have a base case?

Infinite loop condition occurrence

System gets hanged

After 10000 executions program will be automatically stopped

None of the mentioned

184.
Which of these is not a correct statement?

A recursive method must have a base case

Recursion always uses stack

Recursion is always managed by C# Runtime environment

Recursive methods are faster that programmer written loop to call the function repeatedly using a stack

185.
What will be the correct output for the given code snippet?
 class recursion 
 {
     int fact(int n) 
     {
         int result;
         if (n == 1)
         return 1;
         result = fact(n - 1) * n;
         return result;
     }
 } 
 class Program 
 {
     public static void main(String args[]) 
     {
         recursion obj = new recursion() ;
         Console.WriteLine(obj.fact(4));
     }
 }

24

30

120

144

186.
What will be the correct output the for the given code snippet?
class maths 
 {
     int fact(int n) 
     {
         int result;
         if (n == 1)
         return 1;
         result = fact(n - 1) * n;
         return result;
     }
 } 
 class Output 
 {
     static void main(String args[]) 
     {
         maths obj = new maths() ;
         Console.WriteLine(obj.fact(1));
     }
 } 

2

10

1

0

187.
What will be the correct output for the given code snippet?
 class maths 
 {
     int fact(int n) 
     {
         int result;
         if (n == 1)
         return 1;
         result = fact(n - 1) * n;
         return result;
     }
 } 
 class Output 
 {
     static void main(String args[]) 
     {
         maths obj = new maths() ;
         Console.WriteLine(obj.fact(4)*obj.fact(2));
     }
 }

64

60

120

48

188.
What will be the correct output for the given code snippet?
class maths 
 {
     int fact(int n) 
     {
         int result;
         if (n == 1)
         return 1;
         result = fact(n - 1) * n;
         return result;
     }
 } 
 class Output 
 {
     static void main(String args[]) 
     {
         maths obj = new maths() ;
         Console.WriteLine(obj.fact(4)*(3));
     }
 } 

64

60

72

84

190.
What will be the output of the given code snippet?
class maths
 {
     public int fact(int n)
     {
         int result;
         result = fact(n - 1) * n;
         return result;
     }
 } 
 class Program
 {
     static void Main(string[] args)
     {            
         maths obj = new maths();
         Console.WriteLine(obj.fact(4));
         Console.ReadLine();
     }
 } 

24

30

Compile time error

Runtime Error

191.
What will be the correct output for the given code snippet?
class maths
 {
     public int fact(int n)
     {
         int result;
         if (n == 2)
         return 1;
         result = fact(n - 1) * n;
         return result;
     }
 } 
 class Program
 {
     static void Main(string[] args)
     {            
         maths obj = new maths();
         Console.WriteLine(obj.fact(4));
         Console.ReadLine();
     }
 } 

24

0

12

1

error: You are not allowed to do so.....
0Shares
0
Scroll to Top