Online Exam Quiz

questionQuestion  1 to 30

Which interface does java.util.Hashtable implement?

  • Collection
  • List
  • Set
  • Map
Mark for review

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

  • void
  • int
  • String
  • float
Mark for review

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

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

What is the use of the final keyword in Java?

  • To mark a class as not extendable
  • To mark a method as not overridable
  • To mark a variable as constant
  • All of the above
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 of the following is used to terminate a thread in Java?

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

Which of these methods deletes all the elements from invoking collection?

  • clear()
  • reset()
  • delete()
  • refresh()
Mark for review

Which of the following is NOT a feature of Java?

  • Platform independence
  • Object-oriented
  • Distributed computing
  • Pointer manipulation
Mark for review

Which keyword is used in Java to create an interface?

  • interface
  • Interface
  • implements
  • Interfaces
Mark for review

Which of the following is a checked exception?

  • NullPointerException
  • ClassCastException
  • IOException
  • ArrayIndexOutOfBoundsException
Mark for review

Which of these are selection statements in Java?

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

In Java, which keyword is used to prevent a class from being inherited?

  • finalize
  • finally
  • static
  • final
Mark for review

Which of the following is true about the String class in Java?

  • Strings are mutable
  • Strings are immutable
  • Strings are of fixed length
  • Strings are primitive types
Mark for review

What does the 'super' keyword in Java do?

  • Refers to the current object
  • Refers to the parent class object
  • Refers to a static method
  • Refers to a private method
Mark for review

Which of these method of class String is used to compare two String objects for their equality?

  • equals()
  • Equals()
  • isequal()
  • Isequal()
Mark for review

In which memory a String is stored, when we create a string using new operator?

  • Stack
  • String Pool
  • Heap memory
  • Random memory
Mark for review

Which method must be implemented by all threads in Java?

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

What is the default size of the HashMap in Java?

  • 8
  • 16
  • 32
  • 64
Mark for review

What does the 'instanceof' keyword do in Java?

  • Checks if an object is an instance of a class
  • Compares two objects
  • Checks if an object is not null
  • Checks if a variable is initialized
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 class is used to read characters in Java?

  • FileReader
  • FileInputStream
  • BufferedInputStream
  • DataInputStream
Mark for review

Which of the following methods is used to start a thread execution?

  • execute()
  • begin()
  • start()
  • run()
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 these classes is not a member class of java.io package?

  • File
  • String
  • Writer
  • Reader
Mark for review

Which method of the Class.class is used to determine the name of a class represented by the class object as a String?

  • getClass()
  • Intern()
  • getName()
  • toString()
Mark for review

Which of these methods is used to access members of a class in Java?

  • dot operator (.)
  • arrow operator (->)
  • star operator (*)
  • pointer operator (&)
Mark for review

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

  • ArrayList
  • HashMap
  • List
  • TreeMap
Mark for review

What does the 'this' keyword refer to in a Java method?

  • The current class
  • The parent class
  • The current object
  • The child class
Mark for review

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

  • Factory
  • Singleton
  • Observer
  • Prototype
Mark for review

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

  • Stack
  • Dictionary
  • ArrayList
  • HashTable
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