Took the exam this morning and passed with 77%. Good exam, but it made me wonder about a few things. When a class contains a static string member, I thought it was automatically initialized to "". So I could use it in an instance method (to print it for example). But now I am not so sure anymore. Any clarification?
Oliver Grass
Ranch Hand
Joined: Nov 02, 2000
Posts: 65
posted
0
Hi Chris, congrats for the 77%. Not bad... :-))
Originally posted by Chris Meijers: When a class contains a static string member, I thought it was automatically initialized to "". So I could use it in an instance method (to print it for example). But now I am not so sure anymore. Any clarification?
Nope, that's not right... String is an Object, and object will always be initialized with null.
You will get s = null as output. Hope that clarifies a bit, correct me if i'm wrong Oliver
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.