Online Exam Quiz

questionQuestion  1 to 30

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 method is used to return the name of a thread?

  • getName()
  • getId()
  • getThread()
  • getThreadName()
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

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

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 method in the Servlet interface is called once to initialize the servlet?

  • init()
  • start()
  • initServlet()
  • service()
Mark for review

Which of these method of class String is used to obtain length of String object?

  • get()
  • Sizeof()
  • lengthof()
  • length()
Mark for review

Which of these standard collection classes implements a dynamic array?

  • ArrayList
  • LinkedList
  • HashSet
  • HashMap
Mark for review

What is the return type of the hashCode() method in Java?

  • int
  • float
  • double
  • long
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 the local variables?

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

Which method is used to find the length of a string in Java?

  • length()
  • size()
  • getLength()
  • Length()
Mark for review

Which method must be implemented by all threads in Java?

  • start()
  • run()
  • stop()
  • main()
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 is the default size of the HashMap in Java?

  • 8
  • 16
  • 32
  • 64
Mark for review

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

  • char ch = 'A';
  • char ch = "A";
  • char ch = A;
  • char ch = 'A"';
Mark for review

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

  • Factory
  • Singleton
  • Observer
  • Prototype
Mark for review

Which class is used to read characters in Java?

  • FileReader
  • FileInputStream
  • BufferedInputStream
  • DataInputStream
Mark for review

Which of the following is a marker interface?

  • Serializable
  • Cloneable
  • Remote
  • All of the above
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 cannot be used for a variable name in Java?

  • identifier & keyword
  • identifier
  • keyword
  • None of the above
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

In which package is the JDBC API included?

  • javax.swing
  • java.net
  • java.sql
  • java.util
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 the following is a core interface in Java Collections Framework?

  • ArrayList
  • HashMap
  • List
  • TreeMap
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 does JVM stand for in Java?

  • Java Variable Model
  • Java Virtual Machine
  • Java Visual Model
  • Java Version Machine
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 is used for inter-thread communication in Java?

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

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

  • execute()
  • begin()
  • start()
  • run()
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