C# Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 292 Page Views: 

Write the syntax of calling an overloaded constructor within a constructor?



Posted By: Avi Date: 1 October 2010 11:34:31 AM
 Answer:

Syntax:- class sum1 { sum1(int count) { } } class sum0 : sum1 { sum0() : sum1(2) // calling base constructor sum1(2) { } sum0(int count) : this() // calling sum0() { } public static void Main() {} }


Posted By: avibtech


Date: 1 October 2010 11:34:31 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image S5NeIb
Related Questions
C# : What is Lambda Expression in C#?

What is Lambda Expression in C#?

Lambada Expression is an anonymous function that can hold statements and expressions. It can also b....
Category: C# Date: 10/1/2010 11:49:31 AM
C# : Write a code in c# to run the program at particular time?

Write a code in c# to run the program at particular time?

public static void Main() { Timer t = new Timer(); t.Elapsed += new ElapsedEventHandler(OnElapsedTim....
Category: C# Date: 10/1/2010 11:48:31 AM
C# : Who developed C# and when?

Who developed C# and when?

C# was developed in 2000 is known as Microsoft's flagship language. It was developed by Microsoft wi....
Category: C# Date: 10/1/2010 11:47:31 AM
C# : Give some difference between C# and C++?

Give some difference between C# and C++?

1. C++ code usually compiles to assembly language whereas C# compiles to Intermediate language . 2. ....
Category: C# Date: 10/1/2010 11:46:31 AM
C# : Why a compiler adds a default constructor to a class?

Why a compiler adds a default constructor to a class?

Whenever the constructor is not defined by the programmer the compiler will automatically add a cons....
Category: C# Date: 10/1/2010 11:45:31 AM