Online Exam Quiz

questionQuestion  1 to 30

Which method is used to handle mouse click events in Java?

  • mouseClicked()
  • mousePressed()
  • mouseReleased()
  • mouseMoved()
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 method must be implemented by all threads?

  • wait()
  • start()
  • run()
  • stop()
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 the default value of the local variables?

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

In which memory a String is stored, when we create a string using new operator?

  • Stack
  • String Pool
  • Heap memory
  • Random memory
Mark for review

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

  • ArrayList
  • Arrays
  • Collections
  • Vector
Mark for review

What does the 'this' keyword refer to in a Java method?

  • The current class
  • The parent class
  • The current object
  • The child class
Mark for review

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

  • Make the class final
  • Make all fields private
  • Provide only getter methods
  • All of the above
Mark for review

Which of these classes implements Set interface?

  • HashMap
  • HashSet
  • HashTable
  • ArrayList
Mark for review

Which method in the Servlet interface is called once to initialize the servlet?

  • init()
  • start()
  • initServlet()
  • service()
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

What is the extension of compiled java classes?

  • .java
  • .txt
  • .class
  • .js
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

What is the main purpose of the Java Compiler?

  • To run Java applications
  • To translate bytecode into machine code
  • To translate Java source code into bytecode
  • To interpret Java bytecode
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 packages contains the exception StackOverflowError?

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

What is the size of int in Java?

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

What does the 'super' keyword in Java do?

  • Refers to the current object
  • Refers to the parent class object
  • Refers to a static method
  • Refers to a private method
Mark for review

Which of the following is used to find and fix bugs in the Java programs?

  • JVM
  • JRE
  • JDK
  • JDB
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

What is the purpose of the volatile keyword in Java?

  • To increase the access level
  • To indicate that a variable may be changed unexpectedly
  • To mark a method as synchronized
  • To create a constant variable
Mark for review

What is the default size of the HashMap in Java?

  • 8
  • 16
  • 32
  • 64
Mark for review

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

  • equals()
  • Equals()
  • isequal()
  • Isequal()
Mark for review

What is the default access modifier in Java?

  • private
  • protected
  • public
  • package-private
Mark for review

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

  • TRUE
  • FALSE
  • null
  • 0
Mark for review

Which of these methods form the interface of Runnable?

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

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

  • pkg
  • Pkg
  • package
  • Package
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 operators is used to allocate memory to array variable in Java?

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