Skip to main content

Classes And Objects In C Sharp — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Classes And Objects In C Sharp — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { Mul(); m(); Console.ReadLine(); } static void Mul() { Console.WriteLine("4"); } static void m() { Console.WriteLine("3"); Mul(); }

Question 2 of 40
★ FPSC ★ PPSC

Which among the following is the correct statement: Constructors are used to?

Question 3 of 40
★ FPSC ★ PPSC

What will be the correct statement of the following C# code? enum color:byte { yellow = 500, green = 1000, pink = 1300 }

Question 4 of 40
★ FPSC ★ PPSC

Choose the correct statement about enum used in C#.NET?

Question 5 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? { struct abc { int i; } class Program { static void Main(string[] args) { abc x = new abc(); abc z; x.i = 10; z = x; z.i = 15; console.Writeline(x.i + " " + y.i) } } }

Question 6 of 40
★ FPSC ★ PPSC

What will be the output of the following C# 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(); } }

Question 7 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? class A { public int i; private int j; } class B :A { void display() { base.j = base.i + 1; Console.WriteLine(base.i + " " + base.j); } } class Program { static void Main(string[] args) { B obj = new B(); obj.i = 1; obj.j = 2; obj.display(); Console.ReadLine(); } }

Question 8 of 40
★ FPSC ★ PPSC

Which of the given modifiers can be used to prevent Method overriding?

Question 9 of 40
★ FPSC ★ PPSC

Which of the following keyword is used to change data and behavior of a base class by replacing a member of the base class with a new derived member?

Question 10 of 40
★ FPSC ★ PPSC

Choose the wrong statement about 'INTERFACE' in C#.NET?

Question 11 of 40
★ FPSC ★ PPSC

Selecting appropriate method out of number of overloaded methods by matching arguments in terms of number, type and order and binding that selected method to object at compile time is called?

Question 12 of 40
★ FPSC ★ PPSC

If no access modifier for a class is specified, then class accessibility is defined as?

Question 13 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int a = 5; int s = 0, c = 0; Mul (a, ref s, ref c); Console.WriteLine(s + "t " +c); Console.ReadLine(); } static void Mul (int x, ref int ss, ref int cc) { ss = x * x; cc = x * x * x; }

Question 14 of 40
★ FPSC ★ PPSC

Number of constructors a class can define is?

Question 15 of 40
★ FPSC ★ PPSC

Correct way to overload +operator?

Question 16 of 40
★ FPSC ★ PPSC

The data members of a class by default are?

Question 17 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int i = 10; double d = 35.78; fun(i); fun(d); Console.ReadLine(); } static void fun(double d) { Console.WriteLine(d); }

Question 18 of 40
★ FPSC ★ PPSC

What will be the Correct statement in the following C# code? class baseclass { int a; public baseclass(int a1) { a = a1; console.writeline(" a "); } class derivedclass : baseclass { public derivedclass (int a1) : base(a1) { console.writeline(" b "); } } class program { static void main(string[] args) { derivedclass d = new derivedclass(20); } } }

Question 19 of 40
★ FPSC ★ PPSC

The process of defining a method in a subclass having same name & type signature as a method in its superclass is known as?

Question 20 of 40
★ FPSC ★ PPSC

Wrong statement about enum used in C#.NET is?

Question 21 of 40
★ FPSC ★ PPSC

What is the return type of destructor?

Question 22 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? class A { public int i; protected int j; } class B : A { public int j; public void display() { base.j = 3; Console.WriteLine(i + " " + j); } } class Program { static void Main(string[] args) { B obj = new B(); obj.i = 1; obj.j = 2; obj.display(); Console.ReadLine(); } }

Question 23 of 40
★ FPSC ★ PPSC

Access specifiers which can be used for an interface are?

Question 24 of 40
★ FPSC ★ PPSC

A class consists of two interfaces with each interface consisting of three methods. The class had no instance data. Which of the following indicates the correct size of object created from this class?

Question 25 of 40
★ FPSC ★ PPSC

Choose the correct statements among the following:

Question 26 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? class overload { public int x; int y; public int add(int a) { x = a + 1; return x; } public int add(int a, int b) { x = a + 2; return x; } } class Program { static void Main(string[] args) { overload obj = new overload(); overload obj1 = new overload(); int a = 0; obj.add(6); obj1.add(6, 2); Console.WriteLine(obj.x); Console.WriteLine(obj1.x); Console.ReadLine(); } }

Question 27 of 40
★ FPSC ★ PPSC

Which reference modifier is used to define reference variable?

Question 28 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? 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(); } }

Question 29 of 40
★ FPSC ★ PPSC

"A mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse. In short it isolates a particular code and data from all other codes and data. A well-defined interface controls access to that particular code and data."

Question 30 of 40
★ FPSC ★ PPSC

To override a method in the subclass, the base class method should be defined as?

Question 31 of 40
★ FPSC ★ PPSC

Calculate the number of bytes a structure variable s occupies in the memory if it is defined as follows. class abc { int i; Decimal d; } struct sample { private int x; private Single y; private trial z; } sample s = new sample();

Question 32 of 40
★ FPSC ★ PPSC

What is Recursion in CSharp defined as?

Question 33 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? 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(); } }

Question 34 of 40
★ FPSC ★ PPSC

Which keyword is used to refer baseclass constructor to subclass constructor?

Question 35 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? class test { public void print() { Console.WriteLine("Csharp:"); } } class Program { static void Main(string[] args) { test t; t.print(); Console.ReadLine(); } }

Question 36 of 40
★ FPSC ★ PPSC

Which return statement correctly returns the output?

Question 37 of 40
★ FPSC ★ PPSC

Which statements among following are correct?

Question 38 of 40
★ FPSC ★ PPSC

Which of these can be used to fully abstract a class from its implementation?

Question 39 of 40
★ FPSC ★ PPSC

Select the class visibility modifiers among the following:

Question 40 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? namespace ConsoleApplication4 { abstract class A { int i; public abstract void display(); } class B: A { public int j; public override void display() { Console.WriteLine(j); } } class Program { static void Main(string[] args) { B obj = new B(); obj.j = 2; obj.display(); Console.ReadLine(); } } }

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →