The String is the most used Java class. Java interview usually starts with tricky questions related to String. This post contains 21 questions with detailed answers for String in Java. 5.Java Multi-Threading and Concurrency Interview Questions Multithreading and Concurrency is a hot topic in Java ...
1. How do you reverse a string in Java? There is noreverse()utility method in theStringclass. However, you can create a character array from the string and then iterate it from the end to the start. You can append the characters to a string builder and finally return the reversed strin...
Garbage collection is one of the most important feature of Java. Garbage collection is also called automatic memory management as JVM automatically removes the unused variables/objects (value is null) from the memory. User program cann't directly free the object from memory, instead it is the jo...
Its very common interview question is that where should we use abstract class and where should we use Java Interfaces in my view this is important to understand to design better java application, you can go for java interface if you only know the name of methods your class shoul...
6. How to Convert from Array to List? This is acoding-related questionthat can be asked at the beginner level. The question intends to check the knowledge of applicants inCollection utility classes. For now, let us learn that there are two utility classes in the Collection framework which ...
8. What is Java-based Configuration in Spring? The central artifacts in Spring’s java-configuration support are@Configurationannotated classes and@Beanannotated methods. The@Beanannotation is used to indicate that a method instantiates, configures and initializes a new object to be managed by the ...
I myself should have participated in no fewer than 40 or 50 interviews in total. In addition, I have compiled this interview question bank by refer...
9. What are applications of OOPs concepts in Java? Ans: Due to its reusability feature, it is widely used in many areas. Some of the important application areas of OOPs are as follows: Real-time systems Object-oriented database Graphical user interface design in the Wi...
Another Java collection question which appear as part ofJava Coding interview questionand appeared in many interviews. As you know there are multiple ways to traverse or iterate Map in Java e.g. for loop, while loop using Iterator etc.4 ways to iterator Map in Javahas detailed explanation and...
Final keyword is used with the class to ensure that no other class can extend it. The string class is an example to explain this Java interview question. Why Java is not purely an object-oriented language? Java is not a pure OOP as it supports primitive data types such as byte, boolean...