Online Exam Quiz

questionQuestion  1 to 30

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 used to create a package in Java?

  • package
  • import
  • include
  • namespace
Mark for review

Which keyword is used to inherit a class in Java?

  • extends
  • implements
  • inherit
  • this
Mark for review

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

  • add()
  • remove()
  • size()
  • length()
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 class is used to read characters from a file?

  • FileReader
  • BufferedReader
  • FileInputStream
  • FileWriter
Mark for review

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

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

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

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

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

  • new
  • create
  • array
  • instance
Mark for review

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

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

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

  • length()
  • size()
  • getSize()
  • getLength()
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 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

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

  • const
  • final
  • static
  • constant
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 not a wrapper class in Java?

  • Integer
  • Float
  • Character
  • String
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 not a valid method of the PriorityQueue class in Java?

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

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

  • int
  • float
  • double
  • real
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 used to handle exceptions in Java?

  • try-catch block
  • if-else statement
  • switch-case statement
  • for loop
Mark for review

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

  • interface
  • enum
  • goto
  • NULL
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 used to create an object in Java?

  • new
  • create
  • object
  • instance
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 not a valid operator in Java?

  • +
  • -
  • *
  • **
Mark for review

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

  • push()
  • pop()
  • size()
  • length()
Mark for review

Which operator is used for concatenation of strings in Java?

  • +
  • -
  • *
  • /
Mark for review

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

  • New
  • Runnable
  • Blocked
  • Running
Mark for review

Which of these classes is a part of Java's Collections framework?

  • Stack
  • ArrayList
  • HashSet
  • All 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