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

  Details of all advertisers registered with the service

Create a list of 6-7 different customers of both types with made-up details built in to the client program - display the details of all advertisers registered with the service,

  Write a java script code for a function called areabox

Write a Html/Java Script code that does the following 1) A Function called AreaBox that takes two parameters,length & width of the rectangle and returns the Area of the Rectangle.

  Create file using any word-processing program or text editor

Create a file using any word-processing program or text editor. Write an application that displays the file's name, containing folder, size, and time of last modification. Save the file as FileStatistics.java.

  Write a class called palatine

Write a class called palatine that converts an STL string into Pig Latin form. The rules for converting a string into Pig Latin are as follows.

  Java program which performs the following

Write a Java program which performs the following: - Reads 25 integers into a 5 by 5 2-D array called R.

  Determine total annual compensation of a salesperson

Write a Java application using NetBeans Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson. Consider the following factors: A salesperson will earn a fixed salary of $45,000

  Basiclinkedtree and bstree classes

This generic class is used in the BasicLinkedTree and BSTree classes.  The class consists of a reference to the data and a reference to the left and right child.Follow the Javadoc that is provided.  The Javadoc only lists those public methods that..

  Definition of constant initialization arrays

You have to extend the definition of constant initialization arrays to multi-dimensional arrays

  Write a method that will perform the a division operation

Write a method that will perform the a division operation (divide by) on the numbers passed to it in two variables (numerator, denominator) and outputs the results. Use a try-catch pair to output an error message if the illegal operation of divide..

  Develop a java application for the local library

You have been requested to develop a Java application for the local library as part of an upgrade initiative. As in all libraries, this is a place where one can check out books

  Generates a random number between 1 and 100

Write a program that generates a random number between 1 and 100 (inclusive) and then prompts the user to guess the number. The user should be given up to 10 chances to guess the number.

  Write java statements that use a for each loop to cycle

Write java statements that use a for each loop to cycle through all the elements in an ArrayList of doubles named grades.

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