InterviewSolution
Saved Bookmarks
| 1. |
What happens when a constructor is defined for an interface?(a) Compilation failure(b) Runtime Exception(c) The interface compiles successfully(d) The implementing class will throw exceptionI have been asked this question in examination.This question is from Interfaces in portion Interfaces & Packages of Java |
|
Answer» CORRECT choice is (a) COMPILATION failure The EXPLANATION: CONSTRUCTOR is not provided by interface as OBJECTS cannot be instantiated. |
|