I am using the following UML and some directions to write a program.
I am currently working on the Butterfly class. Below is what I have so far.
package nuisance;
import java.util.List;
/**
* @author brand
*
*/
public class Butterfly extends Insect {
private List<String> colors;
/**
* @param species
*/
public Butterfly(String species, List<String> colors) {
super(species);
this.colors = colors;
}
public Butterfly(Butterfly butterfly) {
this.butterfly = butterfly;
}
The issue I am having is in the second constructor which is supposed to initialize the fields based on an existing Butterfly object. I feel like I have written it correctly, but I am getting the following error:
Implicit super constructor Insect() is undefined. Must explicitly invoke another constructor.
I have done some research on this and I can't seem to figure out how to fix the issue. Any help would be greatly appreciated!!
Thank you in advance.