Click here to Skip to main content
15,905,593 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to Stop the Form from Closing... Pin
martin_hughes22-Jul-07 10:52
martin_hughes22-Jul-07 10:52 
AnswerRe: How to Stop the Form from Closing... Pin
Luc Pattyn22-Jul-07 11:05
sitebuilderLuc Pattyn22-Jul-07 11:05 
GeneralRe: How to Stop the Form from Closing... Pin
max2929722-Jul-07 11:19
max2929722-Jul-07 11:19 
GeneralRe: How to Stop the Form from Closing... Pin
Luc Pattyn22-Jul-07 17:35
sitebuilderLuc Pattyn22-Jul-07 17:35 
GeneralRe: How to Stop the Form from Closing... Pin
max2929723-Jul-07 8:03
max2929723-Jul-07 8:03 
QuestionDeleting items from ListView Pin
Saikek22-Jul-07 9:33
Saikek22-Jul-07 9:33 
AnswerRe: Deleting items from ListView Pin
Ravi Bhavnani22-Jul-07 13:34
professionalRavi Bhavnani22-Jul-07 13:34 
AnswerRe: Deleting items from ListView Pin
sidbaruah22-Jul-07 20:27
sidbaruah22-Jul-07 20:27 
QuestionProblem with getting string from bytes Pin
nc3b22-Jul-07 8:09
nc3b22-Jul-07 8:09 
AnswerRe: Problem with getting string from bytes Pin
Guffa22-Jul-07 9:05
Guffa22-Jul-07 9:05 
GeneralRe: Problem with getting string from bytes Pin
nc3b22-Jul-07 10:49
nc3b22-Jul-07 10:49 
GeneralRe: Problem with getting string from bytes Pin
Luc Pattyn22-Jul-07 11:03
sitebuilderLuc Pattyn22-Jul-07 11:03 
GeneralRe: Problem with getting string from bytes Pin
nc3b22-Jul-07 11:20
nc3b22-Jul-07 11:20 
GeneralRe: Problem in server or client. Pin
Luc Pattyn22-Jul-07 11:57
sitebuilderLuc Pattyn22-Jul-07 11:57 
AnswerRe: Problem with getting string from bytes Pin
Guffa22-Jul-07 12:40
Guffa22-Jul-07 12:40 
GeneralRe: Problem with getting string from bytes Pin
nc3b22-Jul-07 22:58
nc3b22-Jul-07 22:58 
AnswerRe: Problem with getting string from bytes Pin
Guffa23-Jul-07 0:40
Guffa23-Jul-07 0:40 
GeneralRe: Problem with getting string from bytes Pin
nc3b23-Jul-07 0:45
nc3b23-Jul-07 0:45 
QuestionSkinned Controls Pin
Mahmoud Zidan22-Jul-07 6:40
Mahmoud Zidan22-Jul-07 6:40 
QuestionListing User Accounts Pin
CeleryGod22-Jul-07 4:16
CeleryGod22-Jul-07 4:16 
AnswerRe: Listing User Accounts Pin
mav.northwind22-Jul-07 6:41
mav.northwind22-Jul-07 6:41 
Questionwhich constructor gets called first? Pin
jon-8022-Jul-07 2:40
professionaljon-8022-Jul-07 2:40 
My C# book reads:
In this example, the two-parameter constructor executes before any code in the body of the one-parameter constructor (though in this particular case, since there is no code in the body of the one-parameter con-structor, it makes no difference).

By following through the code it seems that the one-parameter constructor is called first, which in turn calls the two-parameter constructor, so, is this an error, or do you think it might have another meaning?

J.

using System;
using TestConsole.TestClasses;
namespace TestConsole.ConsoleCmds
{
public class TestOne
{
public static void Main()
{
Car myCar = new Car("Proton Persona");
}

}
}
namespace TestConsole.TestClasses
{
class Car
{
private string description;
private uint nWheels;
public Car(string model, uint nWheels)
{
this.description = description;
this.nWheels = nWheels;
}
public Car(string model) : this(model, 4) { }
}
}

Jon

AnswerRe: which constructor gets called first? Pin
Luc Pattyn22-Jul-07 2:52
sitebuilderLuc Pattyn22-Jul-07 2:52 
GeneralRe: which constructor gets called first? Pin
jon-8022-Jul-07 3:18
professionaljon-8022-Jul-07 3:18 
GeneralRe: which constructor gets called first? Pin
Luc Pattyn22-Jul-07 3:35
sitebuilderLuc Pattyn22-Jul-07 3:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.