can anyone tell me the traits that get to the class when it is inside an interface?? are they public ,static (acco to answer)...also final?? (doubt).. 4 is correct coz the methods declared inside an interface are non-static.. right?? 5 is wrong coz there are no static methods inside an interface right ??
1 ) We can make a class in Interface. 2 ) It is not necessary that the class is always public. 3 ) It is not necessary that the class is always static. 4 ) It is right that the class methods cannot call the methods declared in the interface because in interface all methords are only declared but no defination would be given, so as soon as you write a methord name to call the methord to call like you write m1();, you treat it as a call but the JVM treatrs it as declaration of a function and give compile time error that " Return type required ". 5 ) Refer to point 4.
All the data members in an interface are public final static only. i.e we can access those memebers without implementing the interface. They are just like static data members defined inside a class.
The methods declared inside the interface are not static, because we can't call any methods of an interface without implementing and also the methods are abstract inside an interface. Abstract and static wont go well
Classes(like data members) inside an interface by default are static, Coz we can't instantiate an interface to instantiate the nested class inside an interface.