C# exercises on constructor with solutions. EXERCISE-1: Answer the following questions in brief. When a class constructor gets called? If you create 5 objects of a class, then how many time constructors will be called? When you write a constructor, what return type do you write in constructor declaration? Why do you use constructor? EXERCISE-2: […]
Interface-Abstract class – C# Programming Interview Questions
This section contains real OOP C# programming interview questions and answers on C# interfaces and abstract class asked in C# technical interviews to IT professionals. Answers to questions are provide with example and explanation. Also, these technical job interview questions and answers will boost the concept on C# Interface and Abstract class programming. Topic – […]
Constructor and Destructor – C# Programming Questions – Real
This section contains technical C# programming interview questions on constructor and destructor with answers and explanation asked in technical interviews for freshers and experienced. Topic – Constructor and Destructor, Static Constructor in C#, Private constructors etc. Q- What is output of the following program? When we create 2 objects of the class A e.g. A […]
Functions – C# Programming Interview Questions – Real
Only Real C# programming interview questions with answers for freshers and experienced asked in Technical interviews. Q – Does below code compile? If not, what is the issue? Answer: There is a compiler error, as in method Y(out int val),val is being read(at line: Console.WriteLine(“Value:”+val);) before assignment to “out” variable i.e. val =10. we can’t […]
Polymorphism – C# Programming interview Questions
C# programming interview questions and answers on polymorphism with explanation asked in technical job interview for freshers and experienced. Topic – Polymorphism – Method Overloading, Method Overriding and Operator Overloading, virtual. Q – If we call the below statements in main (), what is the wings’ colour of Parrot? Give reason. Bird b = new […]
Exception, Try, Catch – C# Programming Questions
C# tricky and conceptual programming questions and answers with explanation asked in technical interviews.Topic – Exception handling, Try, Catch and Throw. Q- What is return value of the function foo()? Answer: The foo() function will return 5. Explanation: The constrol always comes in finally block, executes statements inside it and returns from it. Hence, “return […]