Online Exam Quiz

questionQuestion  1 to 30

Which method must be implemented by all threads in Java?

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

Which of these are selection statements in Java?

  • if()
  • for()
  • continue
  • break
Mark for review

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

  • JVM
  • JRE
  • JDK
  • JDB
Mark for review

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

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

In Java, 'int' type is a ____.

  • class
  • object
  • data type
  • method
Mark for review

Which method is used to find the length of a string in Java?

  • length()
  • size()
  • getLength()
  • Length()
Mark for review

Which of these method of class String is used to extract a single character from a String object?

  • CHARAT()
  • charat()
  • charAt()
  • CharAt()
Mark for review

Which of these classes are used by Byte streams for input and output operation?

  • InputStream
  • ObjectInputStream
  • Reader
  • InputStreamReader
Mark for review

Which of the following is not a valid Java keyword?

  • strictfp
  • constant
  • goto
  • native
Mark for review

Which of the following is a valid declaration of a char in Java?

  • char ch = 'A';
  • char ch = "A";
  • char ch = A;
  • char ch = 'A"';
Mark for review

Which operator is considered to be with the highest precedence?

  • ()
  • =
  • ?:
  • ++
Mark for review

Which method is used to handle mouse click events in Java?

  • mouseClicked()
  • mousePressed()
  • mouseReleased()
  • mouseMoved()
Mark for review

Which of the following is a core interface in Java Collections Framework?

  • ArrayList
  • HashMap
  • List
  • TreeMap
Mark for review

Which of these packages contains all the collection classes?

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

Which of the following is true about the anonymous inner class?

  • It has only methods
  • Objects can't be created
  • It has a fixed class name
  • It has no class name
Mark for review

Which of the following is used to terminate a thread in Java?

  • terminate()
  • stop()
  • end()
  • destroy()
Mark for review

Which of the following is used to create an immutable class in Java?

  • Make the class final
  • Make all fields private
  • Provide only getter methods
  • All of the above
Mark for review

What is the default value of a boolean variable in Java?

  • TRUE
  • FALSE
  • null
  • 0
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

What is the default value of a boolean variable in Java?

  • TRUE
  • FALSE
  • 0
  • 1
Mark for review

In which package is the JDBC API included?

  • javax.swing
  • java.net
  • java.sql
  • java.util
Mark for review

Which design pattern is used to restrict the instantiation of a class?

  • Factory
  • Singleton
  • Observer
  • Prototype
Mark for review

Which of the following is not a valid Java keyword?

  • transient
  • volatile
  • const
  • synchronized
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 classes is not a member class of java.io package?

  • File
  • String
  • Writer
  • Reader
Mark for review

Which method in the Servlet interface is called once to initialize the servlet?

  • init()
  • start()
  • initServlet()
  • service()
Mark for review

Which of the following classes provides methods to manipulate the size of arrays?

  • ArrayList
  • Arrays
  • Collections
  • Vector
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 the following is not a valid type of inheritance in Java?

  • Single inheritance
  • Multiple inheritance
  • Multilevel inheritance
  • Hierarchical inheritance
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