Example & Tutorial understanding programming in easy ways.

Can we declare a enum within interface ?If Yes then give an example .How we can call enum ?

1. enum may be only private, protected, default, public ,static & abstract.

2. But as we are declare enum into interface so we can''t use abstract, private, protected with enum in within interface

public interface TestR4R {

//enum may be only private,protected,default,public ,static & abstract

//but as we are declare enum into interface so we can''t use abstract,private,protected

publicenum EnumR4R{r4r};

}

class Test implements TestR4R{

public EnumR4R a = EnumR4R.r4r;

}

Read More →