With this declaration of m in subclass b any invocation of


Smalltalk has a mechanism for "unde?ning" a method. Speci?cally, if a class A has method m, then a programmer may cancel m in subclass B by writing m:

self shouldNotImplement

With this declaration of m in subclass B, any invocation of m on a B object will result in a special error indicating that the method should not be used.

(a) What effect does this feature of Smalltalk have on the relationship between inheritance and subtyping?

(b) Suppose class A has methods m and n, and method m is canceled in subclass

B. Method n is inherited and not changed, but method n sends the message m to self. What do you think happens if a B object b is sent a message n? There are two possible outcomes. See if you can identify both, and explain which one you think the designers of Smalltalk would have chosen and why.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: With this declaration of m in subclass b any invocation of
Reference No:- TGS01269961

Expected delivery within 24 Hours