String is immutable in Java

What is an immutable class? An immutable class once instantiated cannot be modified. For example, String is immutable in Java. What is meant by the statement; An immutable class cannot be modified? Let’s try to understand. Once a java.lang.String object

When are classes loaded in Java

When a .java class is compiled, it gets converted into a .class file which sits in the file system of your computer waiting to be loaded into the Java Virtual Machine (JVM). Now the question is, When are classes loaded

How to find Heap size in Java

Java objects reside in a memory area called the heap. It is possible to know the memory specifications of heap in a Java program. In this blog, I’ll demonstrate how to find heap size in Java using the java.lang.Runtime class.