Abstract class glyph {
Abstract void draw ();
Glyph (){
System. Out. println ("glyph () before draw ()");
Draw ();
System. Out. println ("glyph () after draw ()");
}
}
Class roundglyph01 extends glyph {
Int radius = 0;
String S;
Roundglyph01 (int r, string s ){
Radius = R;
This. S = s;
System. Out. println ("roundglyph01.roundglyph (), radius =" + radius + "" + S );
}
Void draw (){
System. Out. println ("roundglyph01.draw (), radius =" + radius + "" + S );
}
}
Class roundglyph02 extends glyph {
Int radius = 0;
String S;
Roundglyph02 (int r, string s ){
Radius = R;
This. S = s;
System. Out. println ("roundglyph02.roundglyph (), radius =" + radius + "" + S );
}
Void draw (){
System. Out. println ("roundglyph02.draw (), radius =" + radius + "" + S );
}
}
Class roundglyph03 extends roundglyph01 {
Int radius = 0;
String S;
Roundglyph03 (int r, string s ){
Radius = R;
This. S = s;
System. Out. println ("roundglyph03.roundglyph (), radius =" + radius + "" + S );
}
Void draw (){
System. Out. println ("roundglyph03.draw (), radius =" + radius + "" + S );
}
}
public class polyconstructors {
Public static void main (string [] ARGs) {
system. out. println ("creating object rounddlyph01... ");
New roundglyph01 (5," string ");
system. out. println ("************************************* *********");
system. out. println ("creating object rounddlyph02... ");
New roundglyph02 (5," string ");
system. out. println ("************************************* *********");
system. out. println ("creating object rounddlyph03... ");
New roundglyph03 (5," string ");
system. out. println ("************************************* *********");
}< BR >}< br>
Compilation result:
Polyconstructors. Java: 40: cannot resolve symbol
Symbol: constructor roundglyph01 ()
Location: Class roundglyph01
Roundglyph03 (int r, string s ){
^
1 error
After testing, if I inherited roundglyph03 from glyph instead of roundglyph01, everything would work normally. Why did the above error occur when I inherited roundglyph01?