InterviewSolution
Saved Bookmarks
| 1. |
How can we identify whether a compilation unit is class or interface from a .class file?(a) Java source file header(b) Extension of compilation unit(c) We cannot differentiate between class and interface(d) The class or interface name should be postfixed with unit typeI have been asked this question during an interview for a job.This is a very interesting question from JDK-JRE-JIT-JVM in division Java Environment & OOPS Concepts of Java |
|
Answer» RIGHT choice is (a) Java source file HEADER Explanation: The Java source file contains a header that DECLARES the type of class or INTERFACE, its visibility with respect to other classes, its name and any SUPERCLASS it may extend, or interface it implements. |
|