Core Java Advanced Questions and Answers

What is the purpose of the Runtime class? - The java runtime system can be accessed by the Runtime class...
Difference between a static and a non-static inner class - Like static methods and static members are defined in a class, a class can also be static...
Difference between the String and StringBuffer classes - String class is immutable. The characters of string objects can not be changed / modified...
What is the Dictionary class? - The Dictionary class is an abstract class. The class maps keys to values...
What is the ResourceBundle class? - A ResourceBundle is a group of related sub classes which are sharing the same base name...
What is the Vector class? - The capability of implementing a growable array of objects is provided by the class Vector...
What is the SimpleTimeZone class? - SimpleTimeZone is a concrete subclass of TimeZone class. The TimeZone class represents a time zone...
What is the purpose of the System class? - System class is provided with useful fields (static members) that are pertaining to the environment...
How are this() and super() used with constructors? - this() constructor is invoked within a method of a class, if the execution of the constructor is to be done before the functionality of that method...
What is the purpose of finalization? - Finalization is the facility to invoke finalized() method. The purpose of finalization is to perform some action before the objects get cleaned up...
Difference between the File and RandomAccessFile classes - The File class is used to perform the operations on files and directories of the file system of an operating system...
Difference between StringBuilder and StringBuffer - StringBuffer is thread safe, where as StringBuilder is not. In other words, StringBuffer class is synchronized and StringBuilder class is not synchronized...
Explain how to implement shallow cloning and deep cloning - Cloning is a process to create copies of objects...
bstract class & Interfaces - An abstract class defines an abstract concept which can’t be instantiated...
Java interface - An interface is a set of method definition without implementation. It is a protocol of...
JAVA JVM and JIT - JVM is a virtual computer that runs the compiled java program. JVM is software that stays on the top...
Java polymorphism - Capacity of a method to do different things based on the object that it is...
Java class loaders - The class loader describes the behavior of converting a named class into the bits responsible for implementing that class...
Java static and dynamic class - Dynamic class loading is achieved through Run time type identification. Also called as reflection...
Java Comparator Interface - Comparators can be used to control the order of certain data structures and collection of objets too...
Java autoboxing and unboxing - Explain autoboxing and unboxing, What is Auto boxing and unboxing?...
Java Map and SortedMap - Maps are used to store the key-Value pairs...
Explain the concepts of Externalizable Interface, Define the purpose of Externalizable Interface...
When serializable interface is declared, the compiler knows that the object has to be handled so as so be able to serialize it...
Java daemon threads - Threads that work in the background to support the runtime environment are called daemon threads...
Javadoc utility enables you to keep the code and the documentation in sync easily. The javadoc utility lets you put your comments...
Java StringBuilder & StringBuffer class - StringBuilder is unsynchronized whereas StringBuffer is synchronized. So when the application needs to be run only...
Java semaphore and monitors - A semaphore is a flag variable used to check whether a resource is currently being used by another thread or process...
Java checked and unchecked exception - The java.lang.Throwable class has two subclasses Error and Exception. There are two types of exceptions...
Java inner classes - Types of inner classes - Local classes, Member classes, Anonymous classes...
What is wrapper classes in Java?, Why do we need wrapper classes in Java?, Features of the Java wrapper Classes...
Java error exception - Errors are abnormal conditions that should never occur. Not to be confused with the compile time errors....
Java pre-emptive scheduling and time slicing - Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks...
Java serializable Interface - If we want to transfer data over a network then it needs to be serialized. Objects cannot be transferred as they are...
Java thread synchronization - A Monitor defines a lock and condition variables for managing concurrent access to shared data...
Java Swing - Classes in swing are not OS dependent. They don’t create peer components, so they are light weight unlike AWT...
Java Stream Tokenizer - The StreamTokenizer class takes an input stream and parses it into " allowing the to be read one at a tokensname...
Java getCodeBase & getDocumentBase - The getCodebase() method is also commonly used to establish a path to other files or folders that are in the same location as the class being run...