W
willy gates
Hello I came across something funny in JBuider today and I thought it
worth posting just in case someone can shine some light on what is
going on. (I didn't post to borland.public.jbuilder because I
couldn't work out which one to post in to get a sensible response)
Interface NoisyAnimal;
Interface BarkingAnimal extends NoisyAnimal;
Class Mammel;
Class HairyMammel extends Mammel;
Class Dog Extends HairyMammel Implements BarkingAnimal;
{
Mammel fido = new Dog();
fido instanceof Dog --- TRUE
fido instanceof Mammel --- TRUE
fido instanceof HairyMammel --- TRUE
fido instanceof BarkingAnimal --- TRUE
fido instanceof NoisyAnimal --- TRUE
}
....but in JBuilder when I evaluate the last expression using the
debugger It get false ( all the others return true). JBuilder
debugger also fails to cast fido into a NoisyAnimal . Is this most
likely to be a JBuilder 7 bug? or was it a bug in an old jre which the
JBuilder debugger uses.
worth posting just in case someone can shine some light on what is
going on. (I didn't post to borland.public.jbuilder because I
couldn't work out which one to post in to get a sensible response)
Interface NoisyAnimal;
Interface BarkingAnimal extends NoisyAnimal;
Class Mammel;
Class HairyMammel extends Mammel;
Class Dog Extends HairyMammel Implements BarkingAnimal;
{
Mammel fido = new Dog();
fido instanceof Dog --- TRUE
fido instanceof Mammel --- TRUE
fido instanceof HairyMammel --- TRUE
fido instanceof BarkingAnimal --- TRUE
fido instanceof NoisyAnimal --- TRUE
}
....but in JBuilder when I evaluate the last expression using the
debugger It get false ( all the others return true). JBuilder
debugger also fails to cast fido into a NoisyAnimal . Is this most
likely to be a JBuilder 7 bug? or was it a bug in an old jre which the
JBuilder debugger uses.