Java Programming Multiple Choice Questions - Interfaces
This section focuses on the "Interfaces" of the Java programming. These Multiple Choice Questions (mcq) should be practiced to improve the Java programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.
1. Which of these keywords is used to define interfaces in Java?
Explanation: interface keywords is used to define interfaces in Java.
2. A java interface can contain _______.
Explanation: An interface can have both final variables and abstract methods.
3. Which of these access specifiers can be used for an interface?
Explanation:Access specifier of interface is either public or no specifier. When no access specifier is used then default access specifier is used due to which interface is available only to other members of the package in which it is declared, when declared public it can be used by any code.
4. Which of the following is a correct interface?
5. Which of the following classes directly implement Set interface?
Explanation: HashSet classes directly implement Set interface
Also check :