Online Test for Java

  1. A constructor that is automatically generated in the absence of explicit constructors called?
    Default Constructor
    Nullary Constructor
    Empty Constructor
    All the above

  1. Which of the following differentiates between overloaded functions and overridden functions?
    Overloading is a dynamic or runtime binding and overridden is a static or compile time binding.
    Overloading is a static or compile time binding and overriding is dynamic or runtime binding.
    Redefining a function in a friend class is called overloading, while redefining a function in a derived class is called as overridden function.
    Redefining a function in a derived class is called function overloading, while redefining a function in a friend class is called function overriding.


  1. Which is not a valid comment style in Java
    /* comment */
    /* comment
    /** comment */
    // comment

  1. The JRE deletes objects when it determines that they are no longer being used. This process is called Garbage Collection.
    True
    False


  1. Which is right way to creating an array of integer?
    javaArray = new int[10];
    javaArray new = myArray[10];
    int[] javaArray = new int[10];
    A and C Both

  1. Which is right way to declare Array?
    int[] myArray;
    int myArray[];
    int []myArray;
    A and B Both

  1. int x[] = new int[]{10,20,30};<br><br>Arrays can also be created and initialize as in above statement.
    True
    False

  1. All binary operators except for the assignment operators are evaluated from Left to Right
    True
    False

Post Your Question
Social Sharing
Search