java - Inheritance to Sub Sub Class -
I am working on an assignment, there is a question about subclass inheritance, in fact the subclass of a subclass There is an issue with I have three squares, fruits (main square), apple (sub-squared of fruit, too abstract), macintosh (apple subclasses). In the fruit there is a series of manufacturer methods, Apple is the essence element and there is a method, and Macintosh has a constructor call for superclass (fruit).
fruit.java
extends the object of the public intangible class {// the name of the name protected string mName; // number of calories protected int mCalories; // Colors color protected color mColor; // Weight of weight, double mowweight preserved in pound; Protected fruit (this ("apple"); // default fruit} protected fruit (name of string) {it (name, 0);} protected fruit (string name, int calorie) {it (name, calories, empty) );} Protected fruit (string name, int calorie, color color) {it (name, calorie, color, 0d);} protected fruit (string name, int calorie, color color, double weight) {this.mName = Name; This.mCalories = Calorie; This.mColor = color; MEMEE = weight;}
Apple.java
Abstract apple apple fruit Expansion of (abstract zero kata) Macintosh.java Public class Macintosh apple (public Macintosh) (super (Macintosh.clash.getSample.com), 200, New Red (), 0.14D);} zero cutting () {setWeight (getWeight () - 0.01d);}}
When I run the program, I get the following error:
super (Macintosh.class.getSimpleName (), 200, new red (), 0.14D); ^ Required: No arguments found: string, int, red, double reason: actual and formal logic list Length 1 error varies
I understand that the error is saying that I'm just confused as to why is it that Uttarakhand is not being given to fruit from apple to macintosh when I I work as a program from the Macintosh classroom, even then it seems that there can not be a class between the two. If anyone can understand that it would be great.
The only way to create the apple is to call one of the consultants provided by Apple ( In this case the default no-RG constructor). When your Macintosh expands Apple, it must use the constructor provided by the apple.
Apple name, int calorie, color color, double weight You must minimize the following constructor from the apple for your code. {Super, Calories, colors, weights); }
Comments
Post a Comment