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.
- Home
- »
- Languages
- »
- Programming Languages Mcqs
- »
- C# Programming Mcqs
- »
- Interfaces,Inheritance & Polymorphism Mcqs
- »
- Page 13
C# Programming Mcqs
- Arrays and Strings mcqs
- Classes and Objects Mcqs
- Collections & Mathematical Functions Mcqs
- Console IO and Stream Classes Mcqs
- Control Instructions Mcqs
- Data Types,Variables & Operators Mcqs
- Delegates and Generics Mcqs
- Functions and Subroutines Mcqs
- Indexers and Exceptions Mcqs
- Interfaces,Inheritance & Polymorphism Mcqs
- Miscellaneous Topics Mcqs
- Namespaces and Preprocessors Mcqs
Computer MCQS
Sciences MCQS
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
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
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
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
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
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
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));
}
}
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));
}
}
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));
}
}
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));
}
}
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
189.
Which of these data types is used by operating system to manage the Recursion in Csharp?
Array
Queue
Tree
Stack
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();
}
}
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
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
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();
}
}
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