Online Exam Quiz

questionQuestion  1 to 30

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

  • JVM
  • JRE
  • JDK
  • JDB
Mark for review

Which method is used to return the name of a thread?

  • getName()
  • getId()
  • getThread()
  • getThreadName()
Mark for review

What is the purpose of the transient keyword in Java?

  • To create a constant
  • To serialize an object
  • To skip serialization of a field
  • To synchronize a method
Mark for review

What is the default value of the local variables?

  • 0
  • null
  • FALSE
  • No default value
Mark for review

When a thread is created and started, what is its initial state?

  • Ready
  • Running
  • Waiting
  • Sleeping
Mark for review

Which of the following is true about a static method?

  • It can access instance variables
  • It can be overridden
  • It cannot be called from a static context
  • It can be called using the class name
Mark for review

What is the purpose of the volatile keyword in Java?

  • To increase the access level
  • To indicate that a variable may be changed unexpectedly
  • To mark a method as synchronized
  • To create a constant variable
Mark for review

Which of these methods can be used to make the main thread wait for all child threads to finish?

  • sleep()
  • isAlive()
  • join()
  • stop()
Mark for review

Which of these operators is used to allocate memory to array variable in Java?

  • malloc
  • alloc
  • new
  • new malloc
Mark for review

Which method is used to perform cleanup operations before an object is garbage collected?

  • finalize()
  • clean()
  • finalizeAll()
  • close()
Mark for review

Which of these access specifiers can be used for an interface?

  • public
  • protected
  • private
  • All of the above
Mark for review

Which of these cannot be used for a variable name in Java?

  • identifier & keyword
  • identifier
  • keyword
  • None of the above
Mark for review

Which of these is used to handle asynchronous events in Java?

  • Event Listeners
  • Exceptions
  • Handlers
  • Event Handlers
Mark for review

What is the return type of the main method in Java?

  • void
  • int
  • String
  • float
Mark for review

Which of the following is not a valid Java keyword?

  • strictfp
  • constant
  • goto
  • native
Mark for review

Which of these operators is used to refer to the current instance of a method or a constructor?

  • this
  • super
  • extern
  • this()
Mark for review

Which keyword is used in Java to create an interface?

  • interface
  • Interface
  • implements
  • Interfaces
Mark for review

What is the purpose of the 'super' keyword in Java?

  • To call a method in the superclass
  • To call a method in the same class
  • To call a method in the subclass
  • To call a method in the parent interface
Mark for review

Which of the following is the correct way of importing an entire package ?pkg??

  • import pkg.*
  • Import pkg.*
  • import pkg.
  • Import pkg.
Mark for review

Which of the following is used for inter-thread communication in Java?

  • notify()
  • wait()
  • notifyAll()
  • All of the above
Mark for review

What is the main advantage of using a lambda expression in Java?

  • Reduces the amount of boilerplate code
  • Increases performance
  • Simplifies code readability
  • All of the above
Mark for review

Which of these classes is not a member class of java.io package?

  • File
  • String
  • Writer
  • Reader
Mark for review

Which of these packages contains the exception StackOverflowError?

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

Which of the following is not a valid type of inheritance in Java?

  • Single inheritance
  • Multiple inheritance
  • Multilevel inheritance
  • Hierarchical inheritance
Mark for review

Which of these methods is not a member of java.lang.String class?

  • replace()
  • compareTo()
  • equals()
  • toString()
Mark for review

Which of these interface is not a part of Java?s collection framework?

  • List
  • Set
  • SortedList
  • Queue
Mark for review

What is the use of the synchronized keyword in Java?

  • To serialize a class
  • To prevent thread interference
  • To prevent method overriding
  • To create a constant variable
Mark for review

What does JVM stand for in Java?

  • Java Variable Model
  • Java Virtual Machine
  • Java Visual Model
  • Java Version Machine
Mark for review

Which method in the HttpServlet class is used to handle GET requests?

  • doGet()
  • doPost()
  • doPut()
  • doDelete()
Mark for review

Which of these keywords is used to define interfaces in Java?

  • interface
  • Interface
  • intf
  • Intf
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