Core Java Interview Questions and Answers For Experienced
1). What do you mean by a JDBC Driver?
JDBC Driver in Java refers to a software component that allows Java application to relate with the database. Core Java Interview Questions There are 4 types of JDBC drivers in Java-JDBC-ODBC bridge driver
Native-API driver (partially java driver)
Network Protocol driver (fully java driver)
Thin driver (fully java driver)
Core Java Interview Questions for Senior Developer
2). What is a Java applet?
The applet is a Java program which is designed for transmitting the Java code over the internet. The execution works automatically by Java-enabled Web Browser. The applet can respond to the user input immediately as it is dynamically programmed.3). What is a numeric promotion?
Numeric promotions of a numeric operator are used for the conversion of the operands into a common type. In order to perform calculation easily, numeric promotion, conversion is performed. It is the conversion of a smaller numeric type to a larger numeric type so that integer and floating-point operations can be performed over it. Here byte, char, and short values are converted to int values. The int values are converted to long values, and the long and float values are converted to double values.4). What is false sharing in the context of multi-threading?
On multi-core systems, false sharing is one of the well-known performance issues. Here each process has its local cache. When threads on a different processor, modify variables false sharing occurs, that resides on the same cache line as shown in the following images Core Java Interview Questions As the thread may access different global variables completely, false sharing can be hard to detect.5). What are the methods used to implement for the key Object in HashMap?
Equals and hashcode methods are to be implemented In order to use any object as Key in HashMap, in Java.Read: Java Developer Role & Responsibilities – Job Description
6). What is an immutable object?
Java classes whose objects cannot be modified once they are created are known as Immutable classes. Any modification of Immutable object results formation of the new object. 7).Differentiate between String Buffer and String Builder in Java?
The only difference between StringBuffer and StringBuilder is that StringBuffer methods are synchronized while StringBuilder is not synchronized. StringBuilder in Java was introduced in Java 5. Core Java Interview Questions 8). What is the difference between factory and abstract factory pattern?
Abstract Factory provides one more level of abstraction. Consider different factories each extended from an Abstract Factory and responsible for the creation of different hierarchies of objects based on the type of factory. E.g. Abstract Factory extended by Automobile Factory, User Factory, Role Factory etc. Each individual factory would be responsible for the creation of objects in that genre 9). Differentiate JAR and WAR files
We are going to share Difference between JAR & WAR File:JAR FILES WAR FILES Full form of JAR files is Java Archive Files. Full form of WAR files is Web Archive Files. Aggregating many files into one is allowed in JAR files XML, Java classes, and JavaServer pages are stored in WAR The JAR is usually used to hold Java classes in a library. Mainly used for Web Application purposes.`
10). What is a JIT compiler?
Just-In-Time(JIT) compiler is used to improve the performance. JIT compiles parts of the bytecode that has similar functionality which in turn reduces the amount of time needed for compilation. The term “compiler” here refers to a translator from the instruction set of a Java virtual machine (JVM) to the instruction set of a specific CPU. 11). What is the multi-catch block in Java?
Multi-catch block makes the code shorter and cleaner when every catch block has a similar code. We can catch multiple exceptions in a single catch block using this feature.