Online Exam Quiz

questionQuestion  1 to 30

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

  • interface
  • Interface
  • intf
  • Intf
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

Which of the following is a marker interface?

  • Runnable
  • Remote
  • Readable
  • Result
Mark for review

How many times can a constructor be called during the lifetime of the object?

  • As many times as necessary
  • Only once
  • Depends on the type of class
  • At least once
Mark for review

Which of these packages contains the exception StackOverflowError?

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

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

  • identifier
  • keyword
  • letter
  • underscore
Mark for review

Which exception is thrown when java is out of memory?

  • MemoryError
  • OutOfMemoryError
  • MemoryOutOfBoundsException
  • MemoryFullException
Mark for review

Which of the following is a marker interface?

  • Serializable
  • Runnable
  • Remote
  • Result
Mark for review

Which keyword is used to declare a constant in Java?

  • const
  • final
  • static
  • constant
Mark for review

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

  • protected
  • private
  • public
  • transient
Mark for review

What is the implicit return type of the constructor?

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

Which method must be implemented by all threads?

  • run()
  • start()
  • stop()
  • main()
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 of these methods is a part of the Thread class?

  • run()
  • start()
  • stop()
  • All of the above
Mark for review

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

  • 0
  • Not a Number
  • Infinity
  • Run time exception
Mark for review

What is the size of an int variable in Java?

  • 4 bytes
  • 2 bytes
  • 8 bytes
  • 16 bytes
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

Which of these statements is incorrect about Thread?

  • start() method is used to begin execution of the thread that is defined by run().
  • run() method ends when execution of the thread ends.
  • A thread can be started by making a call to its start() method.
  • run() method is used to begin execution of a thread before start() method in special cases.
Mark for review

Which keyword is used to refer to the current object?

  • this
  • super
  • self
  • current
Mark for review

What is the size of int variable in Java?

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

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

  • TRUE
  • FALSE
  • 0
  • 1
Mark for review

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

  • new
  • malloc
  • alloc
  • new malloc
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

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 method is the starting point for all Java programs?

  • start()
  • main()
  • init()
  • run()
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 option leads to the portability and security of Java?

  • Bytecode is executed by JVM
  • The applet makes the Java code secure
  • Use of exception handling
  • Dynamic binding between objects
Mark for review

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

  • identifier
  • keyword
  • variable
  • constant
Mark for review

What is the default value of the local variables?

  • null
  • 0
  • depends on the type of variable
  • No default value for local variables
Mark for review

Which of these methods is used to print an object in Java?

  • print()
  • println()
  • printf()
  • all of the mentioned
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