Online Exam Quiz

questionQuestion  1 to 30

What is the base class of all classes in Java?

  • Object
  • Class
  • Base
  • Root
Mark for review

Which method must be implemented by all threads in Java?

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

What is the purpose of the 'super' keyword in Java?

  • To call a method in the superclass
  • To call a method in the same class
  • To call a method in the subclass
  • To call a method in the parent interface
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 is not a valid Java keyword?

  • strictfp
  • constant
  • goto
  • native
Mark for review

Which keyword is used in Java to create an interface?

  • interface
  • Interface
  • implements
  • Interfaces
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 the following is true about the String class in Java?

  • Strings are mutable
  • Strings are immutable
  • Strings are of fixed length
  • Strings are primitive types
Mark for review

Which operator is considered to be with the highest precedence?

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

In Java, which keyword is used to prevent a class from being inherited?

  • finalize
  • finally
  • static
  • final
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 the following is not a valid type of inheritance in Java?

  • Single inheritance
  • Multiple inheritance
  • Multilevel inheritance
  • Hierarchical inheritance
Mark for review

Which of the following is true about a static method?

  • It can access instance variables
  • It can be overridden
  • It cannot be called from a static context
  • It can be called using the class name
Mark for review

Which of these classes implements Set interface?

  • HashMap
  • HashSet
  • HashTable
  • ArrayList
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

Which of these packages contains the exception StackOverflowError?

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

Which of these methods deletes all the elements from invoking collection?

  • clear()
  • reset()
  • delete()
  • refresh()
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 the following classes provides methods to manipulate the size of arrays?

  • ArrayList
  • Arrays
  • Collections
  • Vector
Mark for review

Which of these interface is not a part of Java?s collection framework?

  • List
  • Set
  • SortedList
  • Queue
Mark for review

What does the 'instanceof' keyword do in Java?

  • Checks if an object is an instance of a class
  • Compares two objects
  • Checks if an object is not null
  • Checks if a variable is initialized
Mark for review

What is the main purpose of the Java ClassLoader?

  • To load classes at runtime
  • To compile Java code
  • To execute bytecode
  • To interpret Java code
Mark for review

When a thread is created and started, what is its initial state?

  • Ready
  • Running
  • Waiting
  • Sleeping
Mark for review

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

  • Stack
  • Dictionary
  • ArrayList
  • HashTable
Mark for review

Which method of the Class.class is used to determine the name of a class represented by the class object as a String?

  • getClass()
  • Intern()
  • getName()
  • toString()
Mark for review

Which method must be implemented by all threads?

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

What does JVM stand for in Java?

  • Java Variable Model
  • Java Virtual Machine
  • Java Visual Model
  • Java Version Machine
Mark for review

Which of these packages contains all the collection classes?

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

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

  • File
  • String
  • Writer
  • Reader
Mark for review

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

  • pkg
  • Pkg
  • package
  • Package
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