Online Test for Java

  1. A .class file contains bytecodes?
    True
    False

  1. Constructor overloading is not possible in Java.
    True
    False


  1. To override a method in Java, we need to define a method in sub class with the
    same name, same number of arguments having the same data types as a method in the super class
    different name, same number of arguments having the same data type as a method in the super class
    same name but different number of arguments as a method in the super class
    same name, same number of arguments but different data types as a method in the super class

  1. Which of the following is NOT a keyword in Java?
    Instanceof
    emun
    transient
    strictfp

  1. The modifiers public and static cannot written in either order "public static" or "static public".
    True
    False


  1. Garbage Collection is manual process.
    True
    False

  1. If you access an uninitialized local variable will result?
    Syntax Error
    Compile Time Error
    Run Time Error
    No Error

  1. Choose best option that describes Constructor.
    Have no return type
    Use name of the class and have no return type
    Use name of the class
    None of the above

Post Your Question
Social Sharing
Search