Java Programming Fundamentals Quiz

Test your knowledge of Java programming concepts including threads, collections, exceptions, design patterns, and language features

19 Questions Published

Questions

Question 1 True/False

Can we have try block with out catch?

  1. True
  2. False
Question 2 Multiple Choice (Single Answer)

Java Exception Class is the subclass of

  1. java.lang.Error
  2. java.lang.Throwable
  3. java.lang.Util
  4. java.lang.CheckedException
Question 3 Multiple Choice (Single Answer)

What is StackOverflowError and OutOfMemoryError?

  1. UncheckedException
  2. CheckedException
  3. Error
  4. UnspecifiedException
Question 4 Multiple Choice (Single Answer)

What will happen to the Exception object after exception handling?

  1. It will go for Garbage Collector
  2. It remains in Stack
  3. It will not create any object
  4. Exception objects will not put load on JVM
Question 5 Multiple Choice (Single Answer)

What is NullPointerException

  1. UncheckedException
  2. CheckedException
  3. Error
  4. UnspecifiedException
Question 6 True/False

In HashMap we can add one null key and null value?

  1. True
  2. False
Question 7 True/False

LinkedList is faster than ArrayList if we frequently add and remove the elements?

  1. True
  2. False
Question 8 True/False

Class.forName (String className) is a Dynamic class loading?

  1. True
  2. False
Question 9 True/False

The 'is-a' relationship is one of 'generalization'

  1. True
  2. False
Question 10 True/False

public abstract final method-name(arguments) {} //Can not be compiled?

  1. True
  2. False
Question 11 True/False

Java supports 'Pass-By-Reference'

  1. True
  2. False
Question 12 True/False

We can extends String class.

  1. True
  2. False
Question 13 True/False

A transient variable can not be serialized.

  1. True
  2. False
Question 14 Multiple Choice (Single Answer)

What is this() in class?

  1. this() can be used to invoke a constructor of the same class
  2. this() will create the object of the same class
  3. There is no function called this(). It is a key word.
  4. this() will invoke the constructor of subclass
Question 15 Multiple Choice (Single Answer)

How can a dead thread be restarted?

  1. Thread.start()
  2. Thread.run()
  3. Thread.yield()
  4. A dead thread cannot be restarted.
Question 16 Multiple Choice (Single Answer)

A Factory Pattern is a ___________

  1. singleton pattern.
  2. creational pattern.
  3. command design pattern.
  4. composite design pattern.
Question 17 Multiple Choice (Single Answer)

Which Java operator is right associative?

  1. =
  2. +
  3. >>
  4. <<
Question 18 Multiple Choice (Single Answer)

StringBuffer vs StingBuilder

  1. StringBuilder is immutable but StringBuffer is mutable.
  2. StringBuffer is immutable but StringBuilder is mutable.
  3. StringBuffer is Synchronized but StringBuilder is not.
  4. They both are immutable.
Question 19 Multiple Choice (Single Answer)

A Java Thread can be created by ____________

  1. Implementing Thread interface.
  2. Implementing Cloneable interface.
  3. Implementing the Runnable interface.
  4. We can not create a Thread, JVM has to create it by it's own.