Discussion :: Declarations and Access Control - General Questions (Q.No.14)
Kapil said: (Dec 30, 2010) | |
Class(NonNested) can be public,default,final or abstract. But class can't marked as both fianl and abstract |
Amit said: (Feb 12, 2014) | |
If interface is marked as static then there would be no meaning of using interface. It is meant to be implemented by many classes or interfaces. If we use "static" then there will be only one copy of it which we don't want in anyway! |
Ivan said: (Aug 19, 2014) | |
Final can not be used with the combination interface, its gives an error saying "illegal combination of modifiers". |
Rishi Pathak said: (Nov 26, 2014) | |
This wrong! Interface can't be final. Suppose I Say Final Interface :-). Then we will not be able to Provide body to the method declared in Interface. This will lead to uselessness of interface. So Java Compiler will say WTF! This Is An "illegal combination of modifiers". |
Aayush said: (Jun 22, 2015) | |
Please clear about (4) option. How class can't be protected? |
Agata said: (Jan 28, 2018) | |
public static interface Test {} This code will compile. Answer number (2) should be valid, although I have no idea how to use such construction. |
Post your comments here:
Name *:
Email : (optional)
» Your comments will be displayed only after manual approval.