Online Exam Quiz

questionQuestion  1 to 30

Which of these is a mechanism for naming and visibility control of a class and its content?

  • Object
  • Package
  • Interfaces
  • None of the mentioned
Mark for review

Which keyword is used to declare a constant in Java?

  • const
  • final
  • static
  • constant
Mark for review

Which method can be defined only once in a program?

  • main method
  • finalize method
  • static method
  • private method
Mark for review

Which of the following is not a keyword in Java?

  • static
  • Boolean
  • void
  • private
Mark for review

Which of these statements is incorrect about Thread?

  • start() method is used to begin execution of the thread that is defined by run().
  • run() method ends when execution of the thread ends.
  • A thread can be started by making a call to its start() method.
  • run() method is used to begin execution of a thread before start() method in special cases.
Mark for review

Which method is the starting point for all Java programs?

  • start()
  • main()
  • init()
  • run()
Mark for review

Which of the following is not a Java features?

  • Dynamic
  • Architecture Neutral
  • Use of pointers
  • Object-oriented
Mark for review

Which of these classes are the direct subclasses of the Throwable class?

  • RuntimeException and Error
  • Exception and VirtualMachineError
  • Error and Exception
  • IOException and RuntimeException
Mark for review

Which of the following is not a Java statement?

  • for
  • while
  • continue
  • return
Mark for review

What is the default value of an instance variable?

  • null
  • 0
  • depends on the type of variable
  • default values are same as local variables
Mark for review

Which of the following option leads to the portability and security of Java?

  • Bytecode is executed by JVM
  • The applet makes the Java code secure
  • Use of exception handling
  • Dynamic binding between objects
Mark for review

Which of these statements is correct about interfaces in Java?

  • An interface can have only abstract methods.
  • An interface can have concrete methods.
  • Interfaces cannot be instantiated.
  • All of the mentioned
Mark for review

Which of the following is not an access modifier?

  • public
  • protected
  • void
  • private
Mark for review

What is the return type of the hashCode() method in the Object class?

  • int
  • Object
  • long
  • void
Mark for review

Which keyword is used for inheritance in Java?

  • inherit
  • extends
  • implements
  • inherits
Mark for review

Which exception is thrown when java is out of memory?

  • MemoryError
  • OutOfMemoryError
  • MemoryOutOfBoundsException
  • MemoryFullException
Mark for review

Which method is the entry point for a Java application?

  • main
  • start
  • init
  • run
Mark for review

Which of these packages contains the exception classes?

  • java.lang
  • java.util
  • java.io
  • java.net
Mark for review

What is the default value of a local variable?

  • null
  • 0
  • depends on the data type
  • no default value
Mark for review

Which of these methods is not defined in the Math class?

  • min()
  • max()
  • abs()
  • getExponent()
Mark for review

Which keyword is used for accessing the features of a package?

  • package
  • import
  • extends
  • implements
Mark for review

What is the output of: System.out.println(2 + "2");

  • 4
  • 22
  • "4"
  • "22"
Mark for review

Which of the following is not a type of constructor in Java?

  • Default constructor
  • Parameterized constructor
  • Copy constructor
  • Friend constructor
Mark for review

Which of these classes are thread-safe in Java?

  • Vector
  • ArrayList
  • LinkedList
  • None of the above
Mark for review

What is the default value of an instance variable?

  • null
  • 0
  • depends on the data type
  • depends on the class
Mark for review

Which of the following is used to find and fix bugs in Java programs?

  • JVM
  • JRE
  • JDK
  • JDB
Mark for review

Which of the following is not an access modifier in Java?

  • protected
  • private
  • public
  • transient
Mark for review

Which of these classes is not part of Java's collection framework?

  • ArrayList
  • LinkedList
  • HashSet
  • Hashtable
Mark for review

Which of these methods is used to print an object in Java?

  • print()
  • println()
  • printf()
  • all of the mentioned
Mark for review

Which of the following is a reserved keyword in Java?

  • object
  • strictfp
  • system
  • main
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review