Java Programming Fundamentals Quiz
Test your knowledge of Java programming concepts including threads, collections, exceptions, design patterns, and language features
Questions
Can we have try block with out catch?
- True
- False
Java Exception Class is the subclass of
- java.lang.Error
- java.lang.Throwable
- java.lang.Util
- java.lang.CheckedException
What is StackOverflowError and OutOfMemoryError?
- UncheckedException
- CheckedException
- Error
- UnspecifiedException
What will happen to the Exception object after exception handling?
- It will go for Garbage Collector
- It remains in Stack
- It will not create any object
- Exception objects will not put load on JVM
What is NullPointerException
- UncheckedException
- CheckedException
- Error
- UnspecifiedException
In HashMap we can add one null key and null value?
- True
- False
LinkedList is faster than ArrayList if we frequently add and remove the elements?
- True
- False
Class.forName (String className) is a Dynamic class loading?
- True
- False
The 'is-a' relationship is one of 'generalization'
- True
- False
public abstract final method-name(arguments) {} //Can not be compiled?
- True
- False
Java supports 'Pass-By-Reference'
- True
- False
We can extends String class.
- True
- False
A transient variable can not be serialized.
- True
- False
What is this() in class?
- this() can be used to invoke a constructor of the same class
- this() will create the object of the same class
- There is no function called this(). It is a key word.
- this() will invoke the constructor of subclass
How can a dead thread be restarted?
- Thread.start()
- Thread.run()
- Thread.yield()
- A dead thread cannot be restarted.
A Factory Pattern is a ___________
- singleton pattern.
- creational pattern.
- command design pattern.
- composite design pattern.
Which Java operator is right associative?
- =
- +
- >>
- <<
StringBuffer vs StingBuilder
- StringBuilder is immutable but StringBuffer is mutable.
- StringBuffer is immutable but StringBuilder is mutable.
- StringBuffer is Synchronized but StringBuilder is not.
- They both are immutable.
A Java Thread can be created by ____________
- Implementing Thread interface.
- Implementing Cloneable interface.
- Implementing the Runnable interface.
- We can not create a Thread, JVM has to create it by it's own.