Re: What will be the constructor flow of control

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 11/17/04


Date: Wed, 17 Nov 2004 19:22:19 -0000

Joel Martinez <jdmartinez@ea.com> wrote:
> well ... the code you supplied does not compile so I'm having a hard
> time understanding what exactly you're trying to figure out. member
> variables are intialized when the object is instantiated.
>
> does that help?

I suspect the OP wants to know whether the base constructor is called
before or after the member variables are initialized; see my other
response for an answer.

-- 
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Relevant Pages

  • HPUX, shared library and static member variables
    ... member variables on HPUX with aCC. ... All these unresolved symbols are private static member variables. ... I compile my source files using the following command line: ... -g0 produces debugger information, +Z makes position independent code, ...
    (comp.lang.cpp)
  • Re: HPUX, shared library and static member variables
    ... > member variables on HPUX with aCC. ... I can compile and link the library ... > All these unresolved symbols are private static member variables. ...
    (comp.lang.cpp)
  • Re: Assigning "this"
    ... I also have a function in the class that I would like to change ALL Of the member variables. ... That said, let's go with your example nevertheless, with the assumption that we will ignore .NET's Point struct and assume we have a whole new Point type that is in fact a class... ... Hopefully you can see why, in a class, it doesn't make sense to try to replace the instance reference from within the instance itself. ... Again, I've seen some C# code changing the value of this, but are they in violation of a compile rule? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: java.lang.NullPointerException
    ... > When I compile this "Model.java"with other class and ... > and then run I get the error message that says ... Either uniform is null or the nextIntFromTo method is causing the exception ... They should not give direct access to member variables - bad them! ...
    (comp.lang.java.help)