Online Test for Java

  1. How integer literal can expressed binary data?
    int binaryData = b11010;
    int binaryData = bx11010;
    int binaryData = 0b11010;
    int binaryData = xb11010;

  1. Assignment operator is evaluated Left to Right.
    True
    False


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

  1. Which keyword is used to inherit class?
    inherit
    extends
    inheritance
    extend

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

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


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

  1. A collection of methods with no implementation is called an ________.
    Polymorphism
    Inheritance
    Interface
    Data Binding

  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.

Post Your Question
Social Sharing
Search