Java Quiz: Test Your GK! Trivia

10 Questions | Total Attempts: 937

SettingsSettingsSettings
Java Quiz: Test Your GK! Trivia - Quiz

.


Questions and Answers
  • 1. 
    What of the following is the default value of an instance variable?
    • A. 

      Null

    • B. 

      0

    • C. 

      Depends upon the type of variable

    • D. 

      Not assigned

  • 2. 
    What is the size of the float variable?
    • A. 

      8 bit

    • B. 

      16 bit

    • C. 

      32 bit

    • D. 

      64 bit

  • 3. 
    What is the default value of the String variable?
    • A. 

      ''

    • B. 

      ""

    • C. 

      Null

    • D. 

      Not defined

  • 4. 
    Which of the following is true about public access modifier?
    • A. 

      Variables, methods and constructors which are declared public can be accessed by any class.

    • B. 

      Variables, methods and constructors which are declared public can be accessed by any class lying in same package.

    • C. 

       Variables, methods and constructors which are declared public in the superclass can be accessed only by its child class.

    • D. 

      None of the above.

  • 5. 
    What is Abstraction?
    • A. 

      Abstraction is a technique to define different methods of same type.

    • B. 

      Abstraction is the ability of an object to take on many forms.

    • C. 

      It refers to the ability to make a class abstract in OOP.

    • D. 

      None of the above.

  • 6. 
    What is an applet?
    • A. 

      An applet is a Java program that runs in a Web browser.

    • B. 

      Applet is a standalone java program.

    • C. 

      Applet is a tool.

    • D. 

      Applet is a run time environment.

  • 7. 
    What is NullPointerException?
    • A. 

      A NullPointerException is thrown when calling the instance method of a null object or modifying/accessing field of a null object.

    • B. 

      A NullPointerException is thrown when object is set as null.

    • C. 

      A NullPointerException is thrown when object property is set as null.

    • D. 

      None of the above.

  • 8. 
    What happens when the thread's yield() method is called?
    • A. 

      Thread returns to the ready state.

    • B. 

      Thread returns to the waiting state.

    • C. 

      Thread starts running.

    • D. 

      None of the above.

  • 9. 
    Is it necessary that each try block must be followed by a final block?
    • A. 

      True

    • B. 

      False

  • 10. 
    Which of the following is a marker interface?
    • A. 

      Serializable

    • B. 

      Comparable

    • C. 

      Cloneable

    • D. 

      None of the above.  Show Answer

Back to Top Back to top