Welcome to the Interfaces,Inheritance and Polymorphism MCQs Page
Dive deep into the fascinating world of Interfaces,Inheritance and Polymorphism with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Interfaces,Inheritance and Polymorphism, a crucial aspect of C# programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Interfaces,Inheritance and Polymorphism, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C# programming.
Check out the MCQs below to embark on an enriching journey through Interfaces,Inheritance and Polymorphism. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C# programming.
Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Interfaces,Inheritance and Polymorphism. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!
Interfaces,Inheritance and Polymorphism MCQs | Page 14 of 20
Explore more Topics under C# programming
class a
{
public void fun()
{
Console.WriteLine("base method");
}
}
class b: a
{
public new void fun()
{
Console.WriteLine(" derived method ");
}
}
class Program
{
static void Main(string[] args)
{
b k = new b();
k.fun();
Console.ReadLine();
}
}
class maths
{
public int length;
public int breadth;
public maths(int x, int y)
{
length = x;
breadth = y;
Console.WriteLine(x + y);
}
public maths(double x, int y)
{
length = (int)x;
breadth = y;
Console.WriteLine(x * y);
}
}
class Program
{
static void Main(string[] args)
{
maths m = new maths(20, 40);
maths k = new maths(12.0, 12);
Console.ReadLine();
}
}
class maths
{
public int length;
public int breadth;
public maths(int x)
{
length = x + 1;
}
public maths(int x, int y)
{
length = x + 2;
}
}
class Program
{
static void Main(string[] args)
{
maths m = new maths(6);
maths k = new maths(6, 2);
Console.WriteLine(m.length);
Console.WriteLine(k.length);
Console.ReadLine();
}
}
class maths
{
public maths()
{
Console.WriteLine("constructor 1 :");
}
public maths(int x)
{
int p = 2;
int u;
u = p + x;
Console.WriteLine("constructor 2: " +u);
}
}
class Program
{
static void Main(string[] args)
{
maths k = new maths(4);
maths t = new maths();
Console.ReadLine();
}
}
constructor 1:
class maths
{
int i;
public maths(int x)
{
i = x;
Console.WriteLine(" hello: ");
}
}
class maths1 : maths
{
public maths1(int x) :base(x)
{
Console.WriteLine("bye");
}
}
class Program
{
static void Main(string[] args)
{
maths1 k = new maths1(12);
Console.ReadLine();
}
}
class maths
{
int i;
public maths(int ii)
{
ii = 12;
int j = 12;
int r = ii * j;
Console.WriteLine(r);
}
}
class maths1 : maths
{
public maths1(int u) :base(u)
{
u = 13;
int h = 13;
Console.WriteLine(u + h);
}
}
class maths2 : maths1
{
public maths2(int k) :base(k)
{
k = 24;
int o = 6 ;
Console.WriteLine(k /o);
}
}
class Program
{
static void Main(string[] args)
{
maths2 t = new maths2(10);
Console.ReadLine();
}
}
class maths
{
static maths()
{
int s = 8;
Console.WriteLine(s);
}
public maths(int f)
{
int h = 10;
Console.WriteLine(h);
}
}
class Program
{
static void Main(string[] args)
{
maths p = new maths(0);
Console.ReadLine();
}
}
Suggested Topics
Are you eager to expand your knowledge beyond C# programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!