Unit 2: C# Programming Fundamentals - Subjective Questions

CSE253 — .Net Programming • Practice Questions with Detailed Answers

20 questions

1

Explain the concept of variables and data types in C#. Describe the commonly used value types and reference types with suitable examples.

2

Describe input and output operations in C#. Explain the use of Console.ReadLine(), Console.Write(), Console.WriteLine(), and type conversion methods.

3

Explain the structure and execution flow of a C# Hello World program.

4

Describe conditional statements in C#. Compare if, if-else, nested if, and switch statements with suitable examples.

5

Explain the different types of loops in C#. Discuss for, while, do-while, and foreach loops, including their appropriate uses.

6

What are jump statements in C#? Explain the use of break, continue, goto, return, and throw.

7

Explain one-dimensional and multidimensional arrays in C#. Describe array declaration, initialization, traversal, and common properties.

8

Explain strings in C#. Discuss string immutability and describe important string methods with examples.

9

Compare arrays and collections in C#. Explain the characteristics and uses of List<T>, Dictionary<TKey, TValue>, Queue<T>, and Stack<T>.

10

Explain methods in C#. Discuss method declaration, return types, parameters, method overloading, and the difference between value and reference parameter passing.

11

Describe classes and objects in C#. Explain fields, properties, methods, and object creation with a suitable example.

12

What are constructors in C#? Explain default, parameterized, copy-style, and static constructors, and discuss constructor overloading.

13

Explain access modifiers in C#. Compare public, private, protected, internal, protected internal, and private protected.

14

Explain the four major object-oriented programming concepts in C#: encapsulation, abstraction, inheritance, and polymorphism.

15

Distinguish between method overloading and method overriding in C#. Explain how compile-time and runtime polymorphism are achieved.

16

Explain exception handling in C#. Describe the roles of try, catch, finally, throw, and custom exceptions.

17

Describe file handling in C#. Explain how to create, read, write, append, and close text files using the System.IO namespace.

18

Explain debugging fundamentals in C#. Discuss breakpoints, stepping commands, watches, the call stack, and common debugging practices.

19

Design and explain a C# program that accepts marks for several subjects, calculates the average, assigns a grade using conditional statements, and displays the result.

20

Compare value types and reference types in C# with respect to memory behavior, assignment, parameter passing, and examples.