Java does not have a sizeof operator like C++ does. Java uses automatic memory management known as the Garbage Collection, hence it is not that important to evaluate size of…
…Java does not have a sizeof operator like C++ does. Java uses automatic memory management known as the Garbage Collection, hence it is not that important to evaluate size of…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs
This is a companion post to 8 Java Memory Management Interview Q&A demonstrating a memory leak scenario step by step with jvisualvm, which is a free profiling tool that gets…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs
Q1. What is the purpose of a Map interface in Java collection API? A1. A map is a set of associations between pairs of objects. One is known as a…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs
Q1. What are the key considerations in processing large files?
A1. Before jumping into coding, get the requirements.
Processing a file involves reading from the disk, processing (e.g. parsing an XML and transforming), and writing back to the disk. It is also a trade off in terms of what is more important to you like having better I/O, better CPU usage, and better memory usage.…
Q1. Are memory leaks possible in Java, which has memory management via automatic Garbage Collection? A1. Memory and resource leaks are possible in any robust application. In managed languages such…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs
Java Garbage Collection interview questions & answers to ascertain your depth of Java knowledge in building industry strength Java applications. Determining optimal Garbage Collection (GC) settings is critical to achieve high throughput & low latency.
Q1. In which part of memory does Java Garbage Collection (i.e. GC) occur?…
Q1. What is the maximum possible length of a Java String & how much heap space do you need to store the maximum possible String object?
A1. A Java String internally uses a char array (i.e. char[]) and the indices of an array is an integer. The maximum value of an integer is Integer.MAX_VALUE,…
Q1. Is there anything wrong with the code snippet shown below?
1 2 3 4 5 6 7 8 9 10 |
public class SumNumbers { public static void main(String[] args) throws InterruptedException{ Integer sum = 0; for (int i = 1000; i < 500000; i++) { sum += i; Thread. |
Q1 How will you go about monitoring your Java application for potential performance or memory issues? A1 1. Visual VM for monitoring Java memory, CPU, threads, etc VisualVM is a…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs