Online Exam Quiz

questionQuestion  1 to 30

What is the extension of compiled java classes?

  • .java
  • .txt
  • .class
  • .js
Mark for review

What is the base class of all classes in Java?

  • Object
  • Class
  • Base
  • Root
Mark for review

Which of the following methods is used to start a thread execution?

  • execute()
  • begin()
  • start()
  • run()
Mark for review

What is the default access modifier in Java?

  • private
  • protected
  • public
  • package-private
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 these methods deletes all the elements from invoking collection?

  • clear()
  • reset()
  • delete()
  • refresh()
Mark for review

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

  • List
  • Set
  • SortedList
  • Queue
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

Which of these classes implements Set interface?

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

Which of these methods form the interface of Runnable?

  • run()
  • stop()
  • start()
  • runThread()
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

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 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

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

  • finalize
  • finally
  • static
  • final
Mark for review

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

  • Stack
  • Dictionary
  • ArrayList
  • HashTable
Mark for review

Which design pattern is used to restrict the instantiation of a class?

  • Factory
  • Singleton
  • Observer
  • Prototype
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

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 the following classes provides methods to manipulate the size of arrays?

  • ArrayList
  • Arrays
  • Collections
  • Vector
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

What is the main advantage of using a lambda expression in Java?

  • Reduces the amount of boilerplate code
  • Increases performance
  • Simplifies code readability
  • All of the above
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

Which of the following is a core interface in Java Collections Framework?

  • ArrayList
  • HashMap
  • List
  • TreeMap
Mark for review

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

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

Which of the following is a valid declaration of a char?

  • char ch = '\utea';
  • char ch = '\uTEA';
  • char ch = '\utea';
  • All of the above
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

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 interface does java.util.Hashtable implement?

  • Collection
  • List
  • Set
  • Map
Mark for review

What is the default value of the local variables?

  • 0
  • null
  • FALSE
  • No default value
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