Online Test for Java

  1. What is the correct signature of the main method?
    public static void main(String[] args)
    static public void main(String[] args)
    public void main(String[] args)
    A and B Both

  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 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 of these is a super class of all errors and exceptions in the Java language?
    RunTimeExceptions
    Throwable
    Catchable
    None of the above

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

  1. Java technology is both a programming language and a platform.
    True
    False


  1. Overloaded methods are differentiated by
    Number of arguments
    Data type of arguments
    Number and the Data type of the arguments
    None of the above

  1. Which of these is supported by method overriding in Java?
    Abstraction
    Encapsulation
    Polymorphism
    None of the mentioned

  1. Which is not a valid keyword in java?
    null
    transient
    synchronized
    native

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

Post Your Question
Social Sharing
Search