Online Exam Quiz

questionQuestion  1 to 30

Which of these is used to handle asynchronous events in Java?

  • Event Listeners
  • Exceptions
  • Handlers
  • Event Handlers
Mark for review

What is the size of int in Java?

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

What is the correct way to declare a generic class in Java?

  • class ClassName<T>
  • class ClassName<T extends E>
  • class ClassName<T implements E>
  • class ClassName<E extends T>
Mark for review

Which of these methods can be used to make the main thread wait for all child threads to finish?

  • sleep()
  • isAlive()
  • join()
  • stop()
Mark for review

Which of the following classes provides methods to manipulate the size of arrays?

  • ArrayList
  • Arrays
  • Collections
  • Vector
Mark for review

Which keyword is used in Java to create an interface?

  • interface
  • Interface
  • implements
  • Interfaces
Mark for review

What is the default size of the HashMap in Java?

  • 8
  • 16
  • 32
  • 64
Mark for review

Which of these classes is not a member class of java.util package?

  • Stack
  • Dictionary
  • ArrayList
  • HashTable
Mark for review

Which of the following is not a valid declaration within an interface?

  • public int method();
  • void method();
  • protected void method();
  • static int method();
Mark for review

What is the main advantage of using Java's multithreading?

  • Increased complexity
  • Reduced performance
  • Improved user experience
  • Lower memory usage
Mark for review

What will happen if we define the main method as private?

  • The program will compile successfully but will not execute
  • The program will give a compilation error
  • The program will compile and execute successfully
  • The program will throw an exception
Mark for review

Which of the following is used for inter-thread communication in Java?

  • notify()
  • wait()
  • notifyAll()
  • All of the above
Mark for review

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

  • interface
  • Interface
  • intf
  • Intf
Mark for review

Which of these classes are used by Byte streams for input and output operation?

  • InputStream
  • ObjectInputStream
  • Reader
  • InputStreamReader
Mark for review

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

  • TRUE
  • FALSE
  • null
  • 0
Mark for review

Which of these operators is used to refer to the current instance of a method or a constructor?

  • this
  • super
  • extern
  • this()
Mark for review

Which of these is not a fundamental data type in Java?

  • int
  • float
  • boolean
  • string
Mark for review

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

  • pkg
  • Pkg
  • import
  • Import
Mark for review

Which of the following is NOT a feature of Java?

  • Platform independence
  • Object-oriented
  • Distributed computing
  • Pointer manipulation
Mark for review

What is byte code in the context of Java?

  • Code written in byte language
  • Code generated after compiling java source code
  • Code generated by the JVM
  • Name of Java source code file
Mark for review

Which of these method of class String is used to extract a single character from a String object?

  • CHARAT()
  • charat()
  • charAt()
  • CharAt()
Mark for review

Which of these are selection statements in Java?

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

Which of these is a superclass of all exceptions?

  • String
  • RuntimeException
  • Throwable
  • Exception
Mark for review

Which of these methods form the interface of Runnable?

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

Which method is used to return the name of a thread?

  • getName()
  • getId()
  • getThread()
  • getThreadName()
Mark for review

Which of these packages contains the exception StackOverflowError?

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

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

  • TRUE
  • FALSE
  • 0
  • 1
Mark for review

Which method is used to perform cleanup operations before an object is garbage collected?

  • finalize()
  • clean()
  • finalizeAll()
  • close()
Mark for review

Which of the following is a marker interface?

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

Which of the following is the correct way of importing an entire package ?pkg??

  • import pkg.*
  • Import pkg.*
  • import pkg.
  • Import pkg.
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