Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

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) The class or interface name should be postfixed with unit type
d) We cannot differentiate between class and interface

Answer: a
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.

Join The Discussion