Object interning

A large program creates a lot of objects in the memory which may affect the program performance. To reduce the required size of memory, Java can store objects in special pools where the same object can be accessed by different references. This technique works only for several widely-used classes and is known as object interning. First, let’s try to comprehend this concept with the example…

Stack trace

In this topic, you will get acquainted with an important feature that will help you with debugging your applications. That feature is called Stack Trace. It shows the call stack in the application up to the point where the stack trace message was generated. It appears as a message in your IDE when the application throws an error. We will analyze an example of such…

Call stack

When you write a program, it probably contains several methods invoking each other, either programmer-defined or standard ones, and all of them need to be executed. How does the machine understand the order of the execution? How does it switch between different methods? How does it know when the program execution is over? To shed light on these questions we need to learn about a…

Class Loader

A typical enterprise Java application may comprise thousands of source and dependency classes. To handle all of them in a proper way JVM introduces a special mechanism called class loader. It is a part of JRE responsible for dynamic loading classes into memory. Understanding class loading allows to control this process and helps to avoid some types of exceptions.

Class files and Bytecode

Bytecode is an intermediate representation of a Java program after the source code compilation. It is stored in .class files. When someone runs a program, JVM executes bytecode, and the program works. Bytecode is also a kind of a language that programmers can directly read, understand, and even modify, but it is more complicated than using Java.