Online Exam Quiz

questionQuestion  1 to 30

Which method must be implemented by all threads?

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

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

  • void
  • int
  • String
  • Object
Mark for review

Which operator is considered to be with the highest precedence?

  • =
  • ==
  • ? :
  • ++
Mark for review

Which of the following is a marker interface in Java?

  • Runnable
  • Serializable
  • Remote
  • ResultSet
Mark for review

What is the size of a char variable in Java?

  • 8 bits
  • 16 bits
  • 32 bits
  • 64 bits
Mark for review

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

  • import
  • package
  • extends
  • implements
Mark for review

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

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

Which of these is used to create an object of a class?

  • Constructor
  • method
  • object
  • class
Mark for review

Which of the following is a reserved keyword in Java?

  • array
  • goto
  • constant
  • var
Mark for review

Which method is used to convert a string to lowercase in Java?

  • toLowerCase()
  • toLower()
  • lower()
  • toLowerString()
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 of these methods are used to register a thread in a thread scheduler?

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

Which method can be used to start a thread execution?

  • run()
  • start()
  • init()
  • resume()
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 class is used to read from a file in Java?

  • FileReader
  • FileWriter
  • BufferedWriter
  • PrintWriter
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

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

  • TRUE
  • FALSE
  • 0
  • 1
Mark for review

What is the default encoding for Java source files?

  • ASCII
  • UTF-8
  • ISO-8859-1
  • UTF-16
Mark for review

Which of the following is the default value of a boolean variable?

  • TRUE
  • FALSE
  • null
  • undefined
Mark for review

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

  • public
  • private
  • protected
  • default
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 is used to find the character at a specific index in a string?

  • charAt()
  • getChar()
  • indexOf()
  • char()
Mark for review

Which of the following is not a Java feature?

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

How many times is the do while loop guaranteed to execute?

  • 0
  • 1
  • 2
  • infinite
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 of these are selection statements in Java?

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

Which keyword is used to declare a constant variable?

  • final
  • static
  • const
  • immutable
Mark for review

Which method is used to compare two strings in Java?

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

What is the use of the static keyword in Java?

  • To create a constant variable
  • To define a method as a class method
  • To make a class method private
  • None of the above
Mark for review

What is the output of 10 + 20 + "30" in Java?

  • "3030"
  • "102030"
  • "30"
  • 60
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