You are viewing a single comment's thread. Return to all comments →
This is specifically what I get when i put in your code:
Your code: class Flower { String whatsYourName() { return "I have many names and types."; } }
class Jasmine extends Flower { @Override String whatsYourName() { return "Jasmine"; } }
class Lily extends Flower { @Override String whatsYourName() { return "Lily"; } }
class Lotus extends Flower { @Override String whatsYourName() { return "Lotus"; } }
class State { Flower yourNationalFlower() { return new Flower(); } }
class WestBengal extends State { @Override Jasmine yourNationalFlower() { return new Jasmine(); } }
class Karnataka extends State { @Override Lotus yourNationalFlower() { return new Lotus(); } }
class AndhraPradesh extends State { @Override Lily yourNationalFlower() { return new Lily(); } }
System Response:
Compile Message
Solution.java:62: error: cannot find symbol Region region = null; ^ symbol: class Region location: class Solution 1 error Exit Status
255
Seems like cookies are disabled on this browser, please enable them to open this website
Covariant Return Types
You are viewing a single comment's thread. Return to all comments →
This is specifically what I get when i put in your code:
Your code: class Flower { String whatsYourName() { return "I have many names and types."; } }
class Jasmine extends Flower { @Override String whatsYourName() { return "Jasmine"; } }
class Lily extends Flower { @Override String whatsYourName() { return "Lily"; } }
class Lotus extends Flower { @Override String whatsYourName() { return "Lotus"; } }
class State { Flower yourNationalFlower() { return new Flower(); } }
class WestBengal extends State { @Override Jasmine yourNationalFlower() { return new Jasmine(); } }
class Karnataka extends State { @Override Lotus yourNationalFlower() { return new Lotus(); } }
class AndhraPradesh extends State { @Override Lily yourNationalFlower() { return new Lily(); } }
System Response:
Compile Message
Solution.java:62: error: cannot find symbol Region region = null; ^ symbol: class Region location: class Solution 1 error Exit Status
255