A
Andy
The code was:
class Employee { }
class VP extends Employee { }
Employee emp;
VP vp;
emp = new Employee();
vp = (VP)emp;
The book was Teach yourself Java 2 SDK 1.5 in 21 days from Sams and it
indicated code similar to the above would compile just fine.
Is that not the case? Or is there some detail that they didn't
mention at that point in the book?
class Employee { }
class VP extends Employee { }
Employee emp;
VP vp;
emp = new Employee();
vp = (VP)emp;
The book was Teach yourself Java 2 SDK 1.5 in 21 days from Sams and it
indicated code similar to the above would compile just fine.
Is that not the case? Or is there some detail that they didn't
mention at that point in the book?