Online Exam Quiz

questionQuestion  1 to 30

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 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

In Java, what is the correct syntax to output "Hello World"?

  • System.out.println("Hello World");
  • print("Hello World");
  • echo("Hello World");
  • Console.WriteLine("Hello World");
Mark for review

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

  • new
  • create
  • object
  • instance
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 valid access modifier in Java?

  • public
  • private
  • protected
  • package
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 size of an int variable in Java?

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

Which of the following is a marker interface?

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

Which method is used to perform some action when an object is to be destroyed?

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

Which of these is used to explain the type of exception that is thrown by a method?

  • throw
  • throws
  • thrown
  • exception
Mark for review

Which of the following is not a Java keyword?

  • static
  • Boolean
  • void
  • private
Mark for review

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

  • TRUE
  • FALSE
  • null
  • 0
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 these classes is not part of Java?s Collection framework?

  • HashMap
  • Hashtable
  • TreeMap
  • LinkedList
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

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

  • TRUE
  • FALSE
  • 0
  • null
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 create a static method in Java?

  • static
  • method
  • function
  • procedure
Mark for review

Which method must be implemented by all threads?

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

Which collection class allows you to grow or shrink its size and provides indexed access to its elements, but whose methods are not synchronized?

  • HashSet
  • LinkedHashSet
  • ArrayList
  • TreeSet
Mark for review

Which method is used to convert a string into a double in Java?

  • parseDouble()
  • valueOf()
  • convert()
  • toDouble()
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 keyword is used for accessing the features of a package?

  • package
  • import
  • extends
  • implements
Mark for review

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

  • int
  • long
  • float
  • double
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 not a valid keyword in Java?

  • static
  • void
  • private
  • constant
Mark for review

Which of the following is not a Java features?

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

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

  • Integer
  • Double
  • Character
  • int
Mark for review

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

  • native
  • method
  • function
  • procedure
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