Online Exam Quiz

questionQuestion  1 to 30

Which of the following is not a valid method of the LinkedList class in Java?

  • add()
  • remove()
  • size()
  • length()
Mark for review

Which of the following is used to create a static method in Java?

  • static
  • method
  • function
  • procedure
Mark for review

Which of the following is true about Java?

  • Java is platform-independent
  • Java is a procedural language
  • Java does not support multithreading
  • Java is not object-oriented
Mark for review

Which method is used to start a thread in Java?

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

Which method is used to start a thread in Java?

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

Which of the following is used to create a volatile variable in Java?

  • volatile
  • variable
  • var
  • volatileVar
Mark for review

What does the 'static' keyword mean in Java?

  • The variable or method is specific to an instance of a class
  • The variable or method is specific to the class
  • The variable or method can be accessed anywhere
  • None of the above
Mark for review

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

  • for
  • while
  • do-while
  • repeat-until
Mark for review

Which of these classes is not part of Java?s Collection framework?

  • HashMap
  • Hashtable
  • TreeMap
  • LinkedList
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 collection class allows you to access its elements by associating a key with an element's value, and provides synchronization?

  • java.util.ArrayList
  • java.util.HashMap
  • java.util.Hashtable
  • java.util.TreeMap
Mark for review

Which of the following is not a Java keyword?

  • static
  • Boolean
  • void
  • private
Mark for review

Which of the following is not a reserved keyword in Java?

  • interface
  • enum
  • goto
  • NULL
Mark for review

What is the default value of the boolean data type in Java?

  • TRUE
  • FALSE
  • 0
  • null
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 is a mechanism for cleaning the internal state of an object before it is removed from memory?

  • finalize()
  • delete()
  • destructor()
  • remove()
Mark for review

What is the size of int in Java?

  • 4 bytes
  • 2 bytes
  • 8 bytes
  • 1 byte
Mark for review

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

  • interface
  • class
  • implements
  • extends
Mark for review

Which of the following is not a wrapper class in Java?

  • Integer
  • Float
  • Character
  • String
Mark for review

Which of the following is not a valid method of the HashSet class in Java?

  • add()
  • remove()
  • size()
  • length()
Mark for review

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

  • Default constructor
  • No-arg constructor
  • Parameterized constructor
  • Copy constructor
Mark for review

Which of the following is not a valid method of the Math class in Java?

  • abs()
  • ceil()
  • floor()
  • round()
Mark for review

Which of the following is used to declare a constant in Java?

  • const
  • final
  • static
  • constant
Mark for review

What is the default encoding for an InputStreamReader?

  • UTF-8
  • ASCII
  • ISO-8859-1
  • UTF-16
Mark for review

Which of the following is not a valid method of the PriorityQueue class in Java?

  • add()
  • remove()
  • size()
  • length()
Mark for review

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

  • malloc
  • alloc
  • new
  • calloc
Mark for review

Which package is directly available to our class without importing it?

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

Which of the following statements is true about Java?

  • Java is a platform-independent language
  • Java is a procedural language
  • Java is a pure object-oriented language
  • Java supports both procedural and object-oriented programming
Mark for review

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

  • Object
  • int
  • long
  • void
Mark for review

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

  • Runnable interface
  • Thread class
  • Both A and B
  • None of the above
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