Online Exam Quiz

questionQuestion  1 to 30

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

  • final
  • class
  • interface
  • extends
Mark for review

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

  • stop()
  • terminate()
  • end()
  • finish()
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 Java features?

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

Which method is used to write bytes to an output stream?

  • read()
  • write()
  • print()
  • display()
Mark for review

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

  • HashMap
  • Hashtable
  • TreeMap
  • LinkedList
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 of the following is not a primitive data type in Java?

  • int
  • float
  • boolean
  • String
Mark for review

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

  • put()
  • get()
  • size()
  • length()
Mark for review

Which of these methods is a part of the Object class in Java?

  • toString()
  • equals()
  • hashCode()
  • All of the above
Mark for review

Which of the following is not a state of a thread?

  • New
  • Runnable
  • Blocked
  • Running
Mark for review

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

  • volatile
  • variable
  • var
  • volatileVar
Mark for review

Which of the following is not a feature of Java?

  • Object-oriented
  • Use of pointers
  • Platform-independent
  • Robust
Mark for review

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

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

What is the size of int in Java?

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

What is the use of the 'final' keyword in Java?

  • To define constants
  • To prevent method overriding
  • To prevent inheritance
  • All of the above
Mark for review

Which of the following is used to handle exceptions in Java?

  • try-catch
  • throw
  • throws
  • All of the above
Mark for review

Which class is used to read characters from a file?

  • FileReader
  • BufferedReader
  • FileInputStream
  • FileWriter
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 the following is a marker interface?

  • Serializable
  • Cloneable
  • Remote
  • All of the above
Mark for review

Which of the following is not a valid Java identifier?

  • _myVar
  • $myVar
  • 123myVar
  • myVar123
Mark for review

Which of the following is a reserved keyword in Java?

  • array
  • goto
  • null
  • constant
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 Java keyword?

  • static
  • Boolean
  • void
  • private
Mark for review

Which of these data types is used to store text in Java?

  • int
  • float
  • char
  • String
Mark for review

Which of the following is not a valid operator in Java?

  • +
  • -
  • *
  • **
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 these methods is used to find the length of a string in Java?

  • length()
  • size()
  • getLength()
  • getSize()
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 method is used to convert a string into a double in Java?

  • parseDouble()
  • valueOf()
  • convert()
  • toDouble()
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