Online Exam Quiz

questionQuestion  1 to 30

Which method is used to convert a string to an integer in Java?

  • parseInt()
  • parseInteger()
  • toInt()
  • toInteger()
Mark for review

What does the AWT stand for?

  • All Window Tools
  • Abstract Window Toolkit
  • Abstract Windows Toolkit
  • All Windows Toolkit
Mark for review

Which method is used to stop the execution of a thread?

  • stop()
  • wait()
  • sleep()
  • terminate()
Mark for review

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

  • import
  • package
  • extends
  • implements
Mark for review

What is the output of 5/2 in Java?

  • 2.5
  • 2
  • 3
  • 2
Mark for review

What is the default value of a local variable?

  • null
  • 0
  • undefined
  • No default value
Mark for review

Which of these methods are used to register a thread in a thread scheduler?

  • run()
  • start()
  • register()
  • None of the above
Mark for review

Which of the following is a mutable class in Java?

  • String
  • StringBuffer
  • StringBuilder
  • Both StringBuffer and StringBuilder
Mark for review

Which exception is thrown when java is out of memory?

  • MemoryError
  • OutOfMemoryError
  • MemoryOutOfBoundsException
  • MemoryFullException
Mark for review

Which of these are selection statements in Java?

  • if()
  • for()
  • continue
  • break()
Mark for review

Which of the following is a marker interface in Java?

  • Runnable
  • Serializable
  • Remote
  • ResultSet
Mark for review

Which of these is not a method of the Math class?

  • min()
  • max()
  • floor()
  • roundOff()
Mark for review

Which class is the parent class of all classes in Java?

  • java.lang.Object
  • java.lang.String
  • java.lang.System
  • java.lang.Exception
Mark for review

Which operator is used to create an object in Java?

  • new
  • create
  • object
  • instance
Mark for review

Which is the correct declaration of an abstract class?

  • abstract class MyClass {}
  • class abstract MyClass {}
  • MyClass abstract class {}
  • None of the above
Mark for review

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

  • getSize()
  • sizeOf()
  • lengthOf()
  • length()
Mark for review

Which of the following is not a valid declaration of a char?

  • char ch = 'A';
  • char ch = 65;
  • char ch = '\u0041';
  • char ch = "A";
Mark for review

Which package contains the Random class?

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

What is the return type of the toString() method?

  • void
  • int
  • String
  • Object
Mark for review

What does the expression float a = 35 / 0 return?

  • Infinity
  • NaN
  • 0
  • ArithmeticException
Mark for review

What is the use of the instanceof keyword in Java?

  • To compare two objects
  • To create an instance of a class
  • To check if an object is an instance of a specific class
  • None of the above
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 method is used to convert a string to lowercase in Java?

  • toLowerCase()
  • toLower()
  • lower()
  • toLowerString()
Mark for review

Which of the following is a wrapper class in Java?

  • int
  • float
  • char
  • Integer
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 above
Mark for review

What is the purpose of the wait(), notify(), and notifyAll() methods in Java?

  • To perform inter-thread communication
  • To perform thread synchronization
  • To handle exceptions
  • None of the above
Mark for review

Which of the following is a marker interface?

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

Which of these access specifiers can be used for a main() method?

  • public
  • private
  • protected
  • default
Mark for review

Which method is used to compare two strings for equality?

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

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

  • public
  • private
  • protected
  • default
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