John Loney

Greenhorn
+ Follow
since Jun 03, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Loney

Oops, I retract that last statement. local variables
cannot be static as noted earlier.
You can do it if your method is declared static.
Another approach similar to the $mid is
substr(int begpos,int endpos) in a for loop
21 years ago
p = d1;
Legal and compile and runtime. This is because
automatic conversions are legal going up the hierarchy. What helps me to remember how this works is to think that since d1 is an object whose class is a subclass of Parent, d1 has all information needed to create an instance of Parent.
Where as if you go down the hierarchy, Parent does not have information to create in instance of
DerivedOne, so you need an explicit cast.