Eclipse has a default Java code formatting profile, known as Eclipse [built-in], which it uses to format code every time you press the combination keys Ctrl + Shift + F (on Windows) and ⌘ + ⇧ + F (on Mac).
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.
How to simulate java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space is an error (not an exception) which is thrown by the Java Virtual Machine (JVM) to indicate that it has run out of heap space. You are trying to create new object(s) but the amount of
Count active HTTP Sessions using HttpSessionListener
javax.servlet.http.HttpSessionListener is an interface which provides the implementing class a capability to keep track of HTTP Session life cycle events. In this post, I’ll demonstrate with the help of a demo project, how to count active HTTP Sessions using HttpSessionListener
How to create cookies in Java servlet
This blog describe how to create cookies in Java servlet. The Java project used as demo in this project has been created using Eclipse and deployed and run on JBoss application server. However, any other web container like Tomcat can
How to call Garbage Collector in Java
Memory management is the process of recognizing when allocated objects are no longer needed, deallocating (freeing) the memory used by such objects, and making it available for subsequent allocations. In Java, memory management is the responsibility of program called the