Click here to Skip to main content
15,898,945 members
Home / Discussions / C#
   

C#

 
GeneralWindows Service class constructor and OnStart method Pin
George_George14-Apr-08 3:20
George_George14-Apr-08 3:20 
GeneralRe: Windows Service class constructor and OnStart method Pin
Mark J. Miller14-Apr-08 4:52
Mark J. Miller14-Apr-08 4:52 
GeneralRe: Windows Service class constructor and OnStart method Pin
George_George14-Apr-08 21:50
George_George14-Apr-08 21:50 
General.Net Profiler Pin
hatemtaleb14-Apr-08 3:05
hatemtaleb14-Apr-08 3:05 
GeneralRe: .Net Profiler Pin
John_Adams14-Apr-08 3:32
John_Adams14-Apr-08 3:32 
GeneralRe: .Net Profiler Pin
Simon P Stevens14-Apr-08 3:33
Simon P Stevens14-Apr-08 3:33 
GeneralRe: .Net Profiler Pin
Pete O'Hanlon14-Apr-08 3:50
mvePete O'Hanlon14-Apr-08 3:50 
Generalconstruction order Pin
George_George14-Apr-08 2:51
George_George14-Apr-08 2:51 
Hello everyone,


For the following code, it is correct to say that,

1. obj1 will be instialized when .NET Runtime loads class Foo and before any instance is created?

2. obj2 will be created each time we create an instance of Foo, and obj2 will be called before constructor?

My question is whether my understanding (1) and (2) are correct?

class Foo
{
    static private object obj1 = new object();
    private object obj2 = new object();
    public Foo()
    {
    }
}



thanks in advance,
George
GeneralRe: construction order Pin
Christian Graus14-Apr-08 3:08
protectorChristian Graus14-Apr-08 3:08 
GeneralRe: construction order Pin
George_George14-Apr-08 3:11
George_George14-Apr-08 3:11 
GeneralRe: construction order Pin
Guffa14-Apr-08 3:42
Guffa14-Apr-08 3:42 
GeneralRe: construction order Pin
George_George14-Apr-08 4:00
George_George14-Apr-08 4:00 
GeneralHiding a tabPage Pin
Harvey Saayman14-Apr-08 2:40
Harvey Saayman14-Apr-08 2:40 
GeneralRe: Hiding a tabPage Pin
phannon8614-Apr-08 2:53
professionalphannon8614-Apr-08 2:53 
GeneralRe: Hiding a tabPage Pin
Harvey Saayman14-Apr-08 2:56
Harvey Saayman14-Apr-08 2:56 
GeneralRe: Hiding a tabPage Pin
phannon8614-Apr-08 2:59
professionalphannon8614-Apr-08 2:59 
GeneralRe: Hiding a tabPage Pin
Harvey Saayman14-Apr-08 3:02
Harvey Saayman14-Apr-08 3:02 
Generalthread safety in Windows Service design Pin
George_George14-Apr-08 2:28
George_George14-Apr-08 2:28 
GeneralRe: thread safety in Windows Service design Pin
Dario Solera14-Apr-08 2:35
Dario Solera14-Apr-08 2:35 
GeneralRe: thread safety in Windows Service design Pin
George_George14-Apr-08 2:44
George_George14-Apr-08 2:44 
GeneralRe: thread safety in Windows Service design Pin
Dario Solera14-Apr-08 3:00
Dario Solera14-Apr-08 3:00 
GeneralRe: thread safety in Windows Service design Pin
George_George14-Apr-08 3:04
George_George14-Apr-08 3:04 
GeneralRe: thread safety in Windows Service design Pin
Dario Solera14-Apr-08 3:20
Dario Solera14-Apr-08 3:20 
GeneralRe: thread safety in Windows Service design Pin
George_George14-Apr-08 3:24
George_George14-Apr-08 3:24 
GeneralMSAccess DB import to SQL server using C# Pin
new2pgrmg14-Apr-08 2:24
new2pgrmg14-Apr-08 2:24 

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.