Home » JAVA Programming » Basic Syntax » Question
  1. How can we identify whether a compilation unit is class or interface from a .class file?
    1. We cannot differentiate between class and interface
    2. The class or interface name should be postfixed with unit type
    3. Extension of compilation unit
    4. Java source file header
    5. None of these
Correct Option: D

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.



Your comments will be displayed only after manual approval.