Bear Bibeault wrote:Look up what the static keyword means.
Bear Bibeault wrote:But do you understand why you got the original results?
Campbell Ritchie wrote:I was wondering why you didn’t suffer an Exception. That is because you can call static members of a class on a null reference, if the compiler can definitely identify the class in advance. [I think that was dubious design in the language; the more you exclude from a language, the easier it is to use.]
Jeff Sadowski wrote:So another question is why didn't the line
create the three objects and just create pointers(is that what happened?)
luck, db
There are no new questions, but there may be new answers.
Darryl Burke wrote:
Jeff Sadowski wrote:So another question is why didn't the line
create the three objects and just create pointers(is that what happened?)
You do realize that an array of type Test[] can hold objects of type Test or any subclass of Test?
Put a lot better than I put itMartin Vajsar wrote: . . . Not allowing to call static methods using a reference would probably be the best way, though.
Darryl Burke wrote:You do realize that an array of type Test[] can hold objects of type Test or any subclass of Test?
luck, db
There are no new questions, but there may be new answers.
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
|