Online Exam Quiz

questionQuestion  1 to 30

Which package contains the Random class?

  • java.util package
  • java.lang package
  • java.awt package
  • java.io package
Mark for review

Which method is used to terminate a thread?

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

What is synchronization in reference to a thread?

  • It?s a process of handling situations when two or more threads need access to a shared resource.
  • It?s a process by which many threads are able to access same shared resource simultaneously.
  • It?s a method that allows threads to communicate with each other.
  • It?s a method of coordinating access to a shared resource.
Mark for review

Which of these cannot be used for a variable name in Java?

  • identifier
  • keyword
  • variable
  • constant
Mark for review

Which keyword is used for accessing the features of a package?

  • package
  • import
  • extends
  • implements
Mark for review

What is the range of short data type in Java?

  • -128 to 127
  • -32768 to 32767
  • -2147483648 to 2147483647
  • None of the mentioned
Mark for review

Which of the following is not a Java statement?

  • for
  • while
  • continue
  • return
Mark for review

Which method must be implemented by all threads?

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

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

  • notify(), wait(), sleep()
  • notify(), wait(), clone()
  • sleep(), wait(), notifyAll()
  • sleep(), wait(), getObject()
Mark for review

What is the implicit return type of the constructor?

  • void
  • int
  • float
  • None of the mentioned
Mark for review

Which of the following is not a keyword in Java?

  • static
  • Boolean
  • void
  • private
Mark for review

Which of the following is not an OOP concept in Java?

  • Polymorphism
  • Inheritance
  • Compilation
  • Encapsulation
Mark for review

Which of the following is not a valid way to create an array in Java?

  • int[] arr = new int[5];
  • int[] arr = {1, 2, 3, 4, 5};
  • int arr[] = new int[5];
  • int arr() = new int[5];
Mark for review

Which of these are valid identifiers?

  • _var
  • $var
  • var
  • All of the mentioned
Mark for review

Which of these methods is used to read a string from the input stream?

  • get()
  • getLine()
  • read()
  • readLine()
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 the following is used to find and fix bugs in Java programs?

  • JVM
  • JRE
  • JDK
  • JDB
Mark for review

Which method is the entry point for a Java application?

  • main
  • start
  • init
  • run
Mark for review

Which of the following is a superclass of every class in Java?

  • ArrayList
  • Abstract class
  • Object class
  • String class
Mark for review

Which of these keywords is used to define interfaces in Java?

  • interface
  • Interface
  • intf
  • Intf
Mark for review

What is the output of: System.out.println(2 + "2");

  • 4
  • 22
  • "4"
  • "22"
Mark for review

Which of these classes is not part of Java's collection framework?

  • ArrayList
  • LinkedList
  • HashSet
  • Hashtable
Mark for review

What is the default value of a float variable?

  • 0.0d
  • 0.0f
  • 0
  • 0
Mark for review

Which of the following is not an access modifier in Java?

  • protected
  • private
  • public
  • transient
Mark for review

What is the default value of the Boolean variable?

  • TRUE
  • FALSE
  • null
  • not defined
Mark for review

Which method must be implemented by all threads?

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

Which operator is used to perform the modulo operation?

  • %
  • /
  • *
  • &
Mark for review

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

  • equals()
  • compare()
  • equalsIgnoreCase()
  • compareTo()
Mark for review

What is the implicit return type of constructor?

  • no return type
  • void
  • int
  • float
Mark for review

Which of these classes are thread-safe in Java?

  • Vector
  • ArrayList
  • LinkedList
  • 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