Sometimes, we need to deal with hardware or external devices from a Java application. One option for communicating with them is to use the COM port (also known as the serial port interface). The serial port does not only allow a direct cable connection via physical ports, but it can also establish a connection via virtual ports for Bluetooth, Wi-Fi devices, etc.
Java applications are executed in Java Virtual Machine (JVM); therefore, they have no direct access to an individual memory address and cannot communicate directly with any hardware devices. In contrast, C/C++ programming languages allow you to directly access memory addresses and thereby access the hardware. What about using the C feature to communicate with hardware and then call created C functions from Java?