Question: Java True or false: The code shown on line 9 of the DividendStock class, super(symbol) illustrated how a subclass can call its parents constructor. call
call Stock's getProtit method a methods share the same name, call stock's version. Again, you do this using the n have DividendStocks ger of its computation. However, since the two ant to you must explicitly tell the compiler that you w Here is the corrected code, which does compile and elma super keyword. redundancy / returns the total protit or loss earned on this stock. including profits made from dividends blic double getProfit (double currentPrice) return super.getProfit(currentpricej dividends And here is the code for the completed Dividendstock c lass: 1 1 A Dividendstock object represents a stock puren 2 // dividends. 3 public class DividendStock extends stock ( purchase that also pays private double dividends; I1 amount of dividends paid // construets a new dividend stock with the given symbol /I and no shares purchased public DividendStock(String symbol) super (symbol): II call Stock constructor dividends -0.0; 10 12 ock, 13 // returns the total profit or loss earned on this st
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
