Click here to Skip to main content
15,896,269 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: which constructor gets called first? Pin
Paul Conrad22-Jul-07 5:34
professionalPaul Conrad22-Jul-07 5:34 
GeneralRe: which constructor gets called first? Pin
Luc Pattyn22-Jul-07 5:46
sitebuilderLuc Pattyn22-Jul-07 5:46 
GeneralRe: which constructor gets called first? Pin
Paul Conrad22-Jul-07 5:49
professionalPaul Conrad22-Jul-07 5:49 
GeneralRe: which constructor gets called first? Pin
Guffa22-Jul-07 9:03
Guffa22-Jul-07 9:03 
GeneralRe: which constructor gets called first? Pin
Paul Conrad22-Jul-07 9:33
professionalPaul Conrad22-Jul-07 9:33 
GeneralRe: which constructor gets called first? Pin
Guffa22-Jul-07 10:11
Guffa22-Jul-07 10:11 
GeneralRe: which constructor gets called first? Pin
Luc Pattyn22-Jul-07 9:39
sitebuilderLuc Pattyn22-Jul-07 9:39 
GeneralRe: which constructor gets called first? Pin
Paul Conrad22-Jul-07 9:51
professionalPaul Conrad22-Jul-07 9:51 
GeneralRe: which constructor gets called first? Pin
Luc Pattyn22-Jul-07 9:57
sitebuilderLuc Pattyn22-Jul-07 9:57 
GeneralRe: which constructor gets called first? Pin
Luc Pattyn22-Jul-07 10:00
sitebuilderLuc Pattyn22-Jul-07 10:00 
GeneralRe: which constructor gets called first? Pin
Paul Conrad22-Jul-07 10:00
professionalPaul Conrad22-Jul-07 10:00 
GeneralRe: which constructor gets called first? Pin
Guffa22-Jul-07 10:15
Guffa22-Jul-07 10:15 
GeneralRe: which constructor gets called first? Pin
Paul Conrad22-Jul-07 10:19
professionalPaul Conrad22-Jul-07 10:19 
GeneralRe: which constructor gets called first? Pin
Luc Pattyn22-Jul-07 10:27
sitebuilderLuc Pattyn22-Jul-07 10:27 

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.