Product.java
public interface Product {
/**
* use this interface for creating your own enumerate of products
*/
public static interface Category {
enum MyCategory {vegetable, fruit, chocolate}; // i create my own enumerate
}
}
in my MyProduct.java i need implement getCategory() method
public class MyProduct implements Product {
@Override
public Category getCategory() {
// ???
}
}
but i don't know how to access enumerate from interface Category and still returning variable of Category. Con you help me please. Sorry for bad description of my problem, but I hope you understand what I need :)
The full name of the enum would be Product.Category.MyCategory (prefixed by the package name if any). Within Product, you can write that as just Category.MyCategory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With