Relationship between inheritance and subtyping

Assignment Help JAVA Programming
Reference no: EM13963503

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.

Reference no: EM13963503

Questions Cloud

How elaborating evolution helps explain social change : Post an explanation of how elaborating evolution helps explain social change. Then, explain how elaborating evolutionary systems might inform how you, as a leader or manager, can enact positive social change
Find recent news that involves information security : For this assignment, you need to find recent news that involves information security breaches. This news must not be older than one year. Then you need to analyse the chosen news and write a report on it. The report should include but not limited to ..
Subtyping and binary methods : This question is about the relationship between subtyping and inheritance. Recall that the main principle associated with subtyping is substitutivity: If A is asubtype of B, then wherever a B object is required in a program
What is the total solar power received by the box : Kyoto box is a simple solar oven used extensively in Africa. Assuming a square box with four reflectors of L = 75 cm, on a sunny day with direct sunlight from the zenith, what is the optimum angle ?? What is the total solar power received by the b..
Relationship between inheritance and subtyping : 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 inherit..
What is the standard deviation of the annual salary : What is Bob's average annual earnings. In the previous question, what is the standard deviation of the annual salary? What is the probability that John will get 2 tickets during the week (Monday-Friday)?
Perceptions of acl rehabilitation : The purpose of this study is obtaining undiscovered perceptions of strength and conditioning coaches (S&C) and physiotherapists', on what defines a successful return to sport following an anterior cruciate ligament (ACL) injury.
Verify the normalization of the ground state of sho : Examine the normalization condition as applied to the second-state wave function. Can you see a way to apply the results of (a) and (b) to evaluate the integral? [Hint: What happens if you regard the SHO parameter a as a variable and differentiate..
Problem regarding the protocol conformance : We can compare Smalltalk interfaces to classes that use protocols, which are lists of operation names (selectors). When a selector allows parameters, as in at: put: , the selector name includes the colons but not the spaces.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Ask the user how many times you want to run

c the algorithm. 2. Then choose a word at random from the array of Strings as the target (Use the integer random number generator)

  Write a java program to simulate a die

Write a Java program to simulate a die. A die has values of either 1, 2, 3, 4, 5 or 6 on the face. You should use the Math.Random() or the java.util.Random() class to generate the values on the die. The program should prompt the user to enter how ..

  What is the arithmetic operation equivalent to shifting left

What is the arithmetic operation equivalent to shifting left with a count of 2? Extend the microcode to include this instruction as a part of IJVM.

  Write a program counter.java that is a thread

Write a program Counter.java that is a Thread that counts up to a limit with random pauses in between each count.

  How to place a cursor at the end of line instead

How to place a cursor at the end of line instead of the beginning of the line? How do you put an exception so that input of a number only falls with in a specific range?

  Total amount of capital gain or loss

Determine the total amount of your capital gain or loss using (a)FIFO (first in, first out) accounting and (b) LIFO (last in, first out) accounting (that is assuming that you keep your stock certification in (a) a queue or (b) a stack using C lang..

  Guess the number game

The user interface is displayed and the user clicks the "Start Game" button to begin the game - Your application then gets a random number in the range 1-1000 inclusive

  Algorithm analysis with advanced data structures

Algorithm Analysis with Advanced Data Structures, Your good friend, a Rock Star, asked you to create a Time Manager app for him, The Rock Star performs gigs at certain dates, all around the country - at most one gig per day

  Create application in java programming

Write method multiple that determines, for a pair of integers, whether the second integer is a multiple of the first.

  Develop game using the concepts of cohesion

Develop any game of your choice using the concepts of Cohesion, Coupling and RDD, i.e., responsibility-driven design.

  Determine the decision of java

Determine the decision of Java as the platform to develop this program. Identify the Java-based technologies utilized in this project and analyze each of them. Then, provide discussion on the purpose of each of the Java-based technologies utiliz..

  Create a program using a gui interface

In your lab5 folder, compile the file that is a starting point for this assignment. The listing and image of this Java class is on the bottom of this lab description. You can create the programs by cutting and pasting.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd